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

Fix llm example. #1350

Merged
merged 1 commit into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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