Skip to content

Commit

Permalink
update running examples with new metric lists
Browse files Browse the repository at this point in the history
Signed-off-by: lilacheden <[email protected]>
  • Loading branch information
lilacheden committed Jan 18, 2025
1 parent dc9e71e commit ea729fb
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions examples/evaluate_rag_end_to_end_dataset_with_given_predictions.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,21 @@
},
]

# select recommended metrics according to your available resources.
metrics = [
"metrics.rag.end_to_end.recommended.cpu_only.all",
# "metrics.rag.end_to_end.recommended.small_llm.all",
# "metrics.rag.end_to_end.recommended.llmaj_watsonx.all",
# "metrics.rag.end_to_end.recommended.llmaj_rits.all"
# "metrics.rag.end_to_end.recommended.llmaj_azure.all"
]

dataset = create_dataset(
task="tasks.rag.end_to_end",
test_set=dataset,
split="test",
postprocessors=[],
metrics=metrics,
)

results = evaluate(predictions, dataset)
Expand Down
10 changes: 10 additions & 0 deletions examples/evaluate_rag_response_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,23 @@
),
)

# select recommended metrics according to your available resources.
metrics = [
"metrics.rag.response_generation.recommended.cpu_only.all",
# "metrics.rag.response_generation.recommended.small_llm.all",
# "metrics.rag.response_generation.recommended.llmaj_watsonx.all",
# "metrics.rag.response_generation.recommended.llmaj_rits.all"
# "metrics.rag.response_generation.recommended.llmaj_azure.all"
]

# Verbalize the dataset using the template
dataset = load_dataset(
card=card,
template_card_index="simple",
format="formats.chat_api",
split="test",
max_test_instances=10,
metrics=metrics,
)


Expand Down

0 comments on commit ea729fb

Please sign in to comment.