Skip to content

Commit cd3e6a7

Browse files
committed
fixed typos and formatting
1 parent 4f7f5bd commit cd3e6a7

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

ch07/04_preference-tuning-with-dpo/create-preference-data-ollama.ipynb

+7-7
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@
4141
" 2. We use the instruction-finetuned LLM to generate multiple responses and have LLMs rank them based on given preference criteria\n",
4242
" 3. We use an LLM to generate preferred and dispreferred responses given certain preference criteria\n",
4343
"- In this notebook, we consider approach 3\n",
44-
"- This notebook uses a 70 billion parameter Llama 3.1-Instruct model through ollama to generate preference labels for an instruction dataset\n",
44+
"- This notebook uses a 70 billion parameters Llama 3.1-Instruct model through ollama to generate preference labels for an instruction dataset\n",
4545
"- The expected format of the instruction dataset is as follows:\n",
4646
"\n",
4747
"\n",
4848
"### Input\n",
4949
"\n",
50-
"```python\n",
50+
"```json\n",
5151
"[\n",
5252
" {\n",
5353
" \"instruction\": \"What is the state capital of California?\",\n",
@@ -71,7 +71,7 @@
7171
"\n",
7272
"The output dataset will look as follows, where more polite responses are preferred (`'chosen'`), and more impolite responses are dispreferred (`'rejected'`):\n",
7373
"\n",
74-
"```python\n",
74+
"```json\n",
7575
"[\n",
7676
" {\n",
7777
" \"instruction\": \"What is the state capital of California?\",\n",
@@ -98,7 +98,7 @@
9898
"]\n",
9999
"```\n",
100100
"\n",
101-
"### Ouput\n",
101+
"### Output\n",
102102
"\n",
103103
"\n",
104104
"\n",
@@ -135,7 +135,7 @@
135135
"id": "8bcdcb34-ac75-4f4f-9505-3ce0666c42d5",
136136
"metadata": {},
137137
"source": [
138-
"## Installing Ollama and Downloading Llama 3"
138+
"## Installing Ollama and Downloading Llama 3.1"
139139
]
140140
},
141141
{
@@ -353,7 +353,7 @@
353353
"source": [
354354
"from pathlib import Path\n",
355355
"\n",
356-
"json_file = Path(\"..\") / \"01_main-chapter-code\" / \"instruction-data.json\"\n",
356+
"json_file = Path(\"..\", \"01_main-chapter-code\", \"instruction-data.json\")\n",
357357
"\n",
358358
"with open(json_file, \"r\") as file:\n",
359359
" json_data = json.load(file)\n",
@@ -498,7 +498,7 @@
498498
"metadata": {},
499499
"source": [
500500
"- If we find that the generated responses above look reasonable, we can go to the next step and apply the prompt to the whole dataset\n",
501-
"- Here, we add a `'chosen`' key for the preferred response and a `'rejected'` response for the dispreferred response"
501+
"- Here, we add a `'chosen'` key for the preferred response and a `'rejected'` response for the dispreferred response"
502502
]
503503
},
504504
{

0 commit comments

Comments
 (0)