Add standalone finetuning and evaluation scripts for chapter 7 (#234)

* add finetuning and eval scripts

* update link

* update links

* fix link
This commit is contained in:
Sebastian Raschka
2024-06-21 05:23:24 -05:00
committed by GitHub
parent 6c84900af7
commit 6c0dc2362b
10 changed files with 153 additions and 10 deletions

View File

@@ -2616,7 +2616,7 @@
}
],
"source": [
"def generate_model_scores(json_data, json_key):\n",
"def generate_model_scores(json_data, json_key, model=\"llama3\"):\n",
" scores = []\n",
" for entry in tqdm(json_data, desc=\"Scoring entries\"):\n",
" prompt = (\n",
@@ -2626,7 +2626,7 @@
" f\" on a scale from 0 to 100, where 100 is the best score. \"\n",
" f\"Respond with the integer number only.\"\n",
" )\n",
" score = query_model(prompt)\n",
" score = query_model(prompt, model)\n",
" try:\n",
" scores.append(int(score))\n",
" except ValueError:\n",