-
Notifications
You must be signed in to change notification settings - Fork 745
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: missing embeddings argument in testset and some E2E tests (#1690)
- Loading branch information
Showing
10 changed files
with
75 additions
and
425 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
from ragas import adapt | ||
from ragas.llms import llm_factory | ||
from ragas.metrics import context_recall | ||
|
||
|
||
def test_adapt(): | ||
adapt([context_recall], language="spanish") | ||
async def test_adapt(): | ||
llm = llm_factory("gpt-4o") | ||
await context_recall.adapt_prompts(llm=llm, language="spanish") | ||
assert context_recall.context_recall_prompt.language == "spanish" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,20 @@ | ||
import typing as t | ||
|
||
from datasets import load_dataset | ||
|
||
from ragas import evaluate | ||
from ragas import EvaluationDataset, evaluate | ||
from ragas.metrics import answer_relevancy, context_precision, faithfulness | ||
from ragas.metrics.critique import harmfulness | ||
from ragas.metrics._aspect_critic import harmfulness | ||
|
||
if t.TYPE_CHECKING: | ||
from datasets import Dataset | ||
|
||
|
||
def test_evaluate_e2e(): | ||
ds = load_dataset("explodinggradients/fiqa", "ragas_eval")["baseline"] | ||
ds = load_dataset("explodinggradients/amnesty_qa", "english_v3")["eval"] # type: ignore | ||
result = evaluate( | ||
ds.select(range(3)), | ||
EvaluationDataset.from_hf_dataset(t.cast("Dataset", ds))[:1], | ||
metrics=[answer_relevancy, context_precision, faithfulness, harmfulness], | ||
show_progress=False, | ||
) | ||
assert result is not None |
Oops, something went wrong.