mirror of
https://github.com/rasbt/LLMs-from-scratch.git
synced 2026-04-10 12:33:42 +00:00
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:
committed by
GitHub
parent
e1046746e8
commit
87deec0f5f
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user