Skip to content

Commit

Permalink
small e2e LLM content updates (#356)
Browse files Browse the repository at this point in the history
  • Loading branch information
marwan116 authored Sep 26, 2024
1 parent e798278 commit 4a963a3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"Here is a diagram that shows a *typical workflow* when working with LLMForge:\n",
"\n",
"\n",
"<img src=\"https://anyscale-public-materials.s3.us-west-2.amazonaws.com/ray-summit/e2e-llms/llmforge-finetune-workflow-v2.png\" width=800>"
"<img src=\"https://anyscale-public-materials.s3.us-west-2.amazonaws.com/ray-summit/e2e-llms/llmforge-finetune-workflow-v3.png\" width=800>"
]
},
{
Expand Down
9 changes: 5 additions & 4 deletions templates/ray-summit-end-to-end-llms/03_Evaluating_LLMs.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"\n",
"import anyscale\n",
"import numpy as np\n",
"import pandas as pd\n",
"import ray\n",
"import re\n",
"\n",
Expand Down Expand Up @@ -912,11 +913,11 @@
"metadata": {},
"outputs": [],
"source": [
"def check_function_type_accuracy(batch: dict) -> dict:\n",
"def check_function_type_accuracy(batch: dict[str, np.ndarray]) -> dict[str, np.ndarray]:\n",
" batch[\"fn_type_match\"] = batch[\"ground_truth_fn_type\"] == batch[\"model_fn_type\"]\n",
" return batch\n",
"\n",
"fn_type_accuracy_percent = test_ds_responses_processed.map(check_function_type_accuracy).mean(on=\"fn_type_match\") * 100 \n",
"fn_type_accuracy_percent = test_ds_responses_processed.map_batches(check_function_type_accuracy).mean(on=\"fn_type_match\") * 100 \n",
"print(f\"The correct function type is predicted at {fn_type_accuracy_percent}% accuracy\")"
]
},
Expand All @@ -926,7 +927,7 @@
"metadata": {},
"outputs": [],
"source": [
"def check_attribute_types_accuracy(batch: dict) -> dict:\n",
"def check_attribute_types_accuracy(batch: pd.DataFrame) -> pd.DataFrame:\n",
" batch[\"attr_types_match\"] = batch[\"ground_truth_attr_types\"].apply(set) == batch[\"model_attr_types\"].apply(set)\n",
" return batch\n",
"\n",
Expand Down Expand Up @@ -1176,7 +1177,7 @@
"metadata": {},
"outputs": [],
"source": [
"fn_type_accuracy_percent_few_shot = test_ds_responses_few_shot.map(check_function_type_accuracy).mean(on=\"fn_type_match\") * 100 \n",
"fn_type_accuracy_percent_few_shot = test_ds_responses_few_shot.map_batches(check_function_type_accuracy).mean(on=\"fn_type_match\") * 100 \n",
"print(f\"The correct function type is predicted at {fn_type_accuracy_percent_few_shot}% accuracy\")"
]
},
Expand Down

0 comments on commit 4a963a3

Please sign in to comment.