Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contradiction in evaluate is_async parameter docstring and code #983

Closed
dschwalm opened this issue May 22, 2024 · 3 comments
Closed

Contradiction in evaluate is_async parameter docstring and code #983

dschwalm opened this issue May 22, 2024 · 3 comments
Labels
documentation Improvements or additions to documentation question Further information is requested

Comments

@dschwalm
Copy link

[ x] I checked the documentation and related resources and couldn't find an answer to my question.

Your Question
Contradiction in evaluate is_async parameter. By default this parameter is True, but according to the documentation, it is False by default. Either the doc or the code is wrong.
I am happy to raise a PR once the decision is made.

Code Examples

`def evaluate(
dataset: Dataset,
metrics: list[Metric] | None = None,
llm: t.Optional[BaseRagasLLM | LangchainLLM] = None,
embeddings: t.Optional[BaseRagasEmbeddings | LangchainEmbeddings] = None,
callbacks: Callbacks = None,
in_ci: bool = False,
is_async: bool = True,
run_config: t.Optional[RunConfig] = None,
raise_exceptions: bool = True,
column_map: t.Optional[t.Dict[str, str]] = None,
) -> Result:
"""
Run the evaluation on the dataset with different metrics

Parameters
----------
dataset : Dataset[question: list[str], contexts: list[list[str]], answer: list[str], ground_truth: list[list[str]]]
    The dataset in the format of ragas which the metrics will use to score the RAG
    pipeline with
metrics : list[Metric] , optional
    List of metrics to use for evaluation. If not provided then ragas will run the
    evaluation on the best set of metrics to give a complete view.
llm: BaseRagasLLM, optional
    The language model to use for the metrics. If not provided then ragas will use
    the default language model for metrics which require an LLM. This can we overridden by the llm specified in
    the metric level with `metric.llm`.
embeddings: BaseRagasEmbeddings, optional
    The embeddings to use for the metrics. If not provided then ragas will use
    the default embeddings for metrics which require embeddings. This can we overridden by the embeddings specified in
    the metric level with `metric.embeddings`.
callbacks: Callbacks, optional
    Lifecycle Langchain Callbacks to run during evaluation. Check the
    [langchain documentation](https://python.langchain.com/docs/modules/callbacks/)
    for more information.
in_ci: bool
    Whether the evaluation is running in CI or not. If set to True then some
    metrics will be run to increase the reproducability of the evaluations. This
    will increase the runtime and cost of evaluations. Default is False.
is_async: bool
    Whether to run the evaluation in async mode or not. If set to True then the
    evaluation is run by calling the `metric.ascore` method. In case the llm or
    embeddings does not support async then the evaluation can be run in sync mode
    with `is_async=False`. Default is False.`
@dschwalm dschwalm added the question Further information is requested label May 22, 2024
@dosubot dosubot bot added the documentation Improvements or additions to documentation label May 22, 2024
@jjmachan
Copy link
Member

Hey @dschwalm 👋🏽

thanks for taking the time for bringing this up. You are right there is an inconsistency with that flag and the reason is that it was something that we didn't remove after a big change to the excutor

I've created #975 to remove it and will take it up this week hopefully

@dschwalm
Copy link
Author

Cool, thank you for responding and keeping the code more consistent.

@jjmachan
Copy link
Member

thanks a lot for reporting this too 🙂, the project has been slow for a while but now its back on track 🚀

closing this for now, feel free to subscribe to the other issue to keep track

we'll get it merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants