mirror of
https://github.com/james-m-jordan/openai-cookbook.git
synced 2025-05-09 19:32:38 +00:00
fix undefined variables in fine tune example (#660)
`create_user_message` and `test_df` are not defined.
This commit is contained in:
parent
35b7123faf
commit
1ae3bf631b
@ -253,11 +253,14 @@
|
||||
"\n",
|
||||
"system_message = \"You are a helpful recipe assistant. You are to extract the generic ingredients from each of the recipes provided.\"\n",
|
||||
"\n",
|
||||
"def create_user_message(row):\n",
|
||||
" return f\"\"\"Title: {row['title']}\\n\\nIngredients: {row['ingredients']}\\n\\nGeneric ingredients: \"\"\"\n",
|
||||
"\n",
|
||||
"def prepare_example_conversation(row):\n",
|
||||
" messages = []\n",
|
||||
" messages.append({\"role\": \"system\", \"content\": system_message})\n",
|
||||
"\n",
|
||||
" user_message = f\"\"\"Title: {row['title']}\\n\\nIngredients: {row['ingredients']}\\n\\nGeneric ingredients: \"\"\"\n",
|
||||
" user_message = create_user_message(row)\n",
|
||||
" messages.append({\"role\": \"user\", \"content\": user_message})\n",
|
||||
"\n",
|
||||
" messages.append({\"role\": \"assistant\", \"content\": row[\"NER\"]})\n",
|
||||
@ -642,6 +645,7 @@
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"test_df = recipe_df.loc[201:300]\n",
|
||||
"test_row = test_df.iloc[0]\n",
|
||||
"test_messages = []\n",
|
||||
"test_messages.append({\"role\": \"system\", \"content\": system_message})\n",
|
||||
|
Loading…
x
Reference in New Issue
Block a user