Skip to content

Commit

Permalink
Fix llm judge example and fix ignore for llm examples. (#1350)
Browse files Browse the repository at this point in the history
  • Loading branch information
Liraim authored Oct 22, 2024
1 parent 082f131 commit edfa07a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
if: matrix.minimal
run: pip install -r requirements.min.txt
- name: Prepare examples dependencies
run: pip install catboost sentence-transformers
run: pip install catboost sentence-transformers openai
- name: Export examples
run: jupyter nbconvert --to python examples/*/*.ipynb --output-dir example_scripts
- name: Run examples
Expand Down
4 changes: 2 additions & 2 deletions example_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"comparing_custom_statest_with_classic_distributions.py",
"how_to_evaluate_llm_with_text_descriptors.py",
"how_to_run_drift_report_for_text_data.py", # too slow & torch version conflict?
"llm_evaluation_tutorial.ipynb", # cloud usage
"llm_tracing_tutorial.ipynb", # cloud usage
"llm_evaluation_tutorial.py", # cloud usage
"llm_tracing_tutorial.py", # cloud usage
]


Expand Down
11 changes: 5 additions & 6 deletions examples/how_to_questions/how_to_use_llm_judge_template.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,7 @@
"id": "204d90a4-694e-406b-949a-f7ba3b601eac",
"metadata": {},
"outputs": [],
"source": [
"print(ToxicityLLMEval().get_template().get_prompt_template())"
]
"source": "print(ToxicityLLMEval().get_template().get_template())"
},
{
"cell_type": "code",
Expand Down Expand Up @@ -308,7 +306,7 @@
"source": [
"#that's how you can see the prompt\n",
"\n",
"print(ContextQualityLLMEval(question=\"question\").get_template().get_prompt_template())"
"print(ContextQualityLLMEval(question=\"question\").get_template().get_template())"
]
},
{
Expand Down Expand Up @@ -414,12 +412,13 @@
" pre_messages=[(\"system\", \"You are a judge which evaluates text.\")],\n",
" ),\n",
" provider = \"openai\",\n",
" model = \"gpt-4o-mini\"\n",
" model = \"gpt-4o-mini\",\n",
" display_name=\"test\"\n",
")\n",
"\n",
"report = Report(metrics=[\n",
" TextEvals(column_name=\"response\", descriptors=[\n",
" custom_judge(display_name=\"test\")\n",
" custom_judge\n",
" ])\n",
"])\n",
"\n",
Expand Down

0 comments on commit edfa07a

Please sign in to comment.