Skip to content

Commit 4d9f9dc

Browse files
authored
Update ollama address (#861)
1 parent 00c240f commit 4d9f9dc

File tree

1 file changed

+27
-5
lines changed

1 file changed

+27
-5
lines changed

ch07/01_main-chapter-code/ch07.ipynb

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2278,19 +2278,39 @@
22782278
},
22792279
{
22802280
"cell_type": "markdown",
2281-
"id": "747a2fc7-282d-47ec-a987-ed0a23ed6822",
2282-
"metadata": {
2283-
"id": "747a2fc7-282d-47ec-a987-ed0a23ed6822"
2284-
},
2281+
"id": "267cd444-3156-46ad-8243-f9e7a55e66e7",
2282+
"metadata": {},
22852283
"source": [
22862284
"- For macOS and Windows users, click on the ollama application you downloaded; if it prompts you to install the command line usage, say \"yes\"\n",
22872285
"- Linux users can use the installation command provided on the ollama website\n",
22882286
"\n",
22892287
"- In general, before we can use ollama from the command line, we have to either start the ollama application or run `ollama serve` in a separate terminal\n",
22902288
"\n",
2291-
"<img src=\"https://sebastianraschka.com/images/LLMs-from-scratch-images/ch07_compressed/ollama-run.webp?1\" width=700px>\n",
2289+
"<img src=\"https://sebastianraschka.com/images/LLMs-from-scratch-images/ch07_compressed/ollama-run.webp?1\" width=700px>"
2290+
]
2291+
},
2292+
{
2293+
"cell_type": "markdown",
2294+
"id": "30266e32-63c4-4f6c-8be3-c99e05ed05b7",
2295+
"metadata": {},
2296+
"source": [
2297+
"---\n",
22922298
"\n",
2299+
"**Note**:\n",
22932300
"\n",
2301+
"- When running `ollama serve` in the terminal, as described above, you may encounter an error message saying `Error: listen tcp 127.0.0.1:11434: bind: address already in use`\n",
2302+
"- If that's the case, try use the command `OLLAMA_HOST=127.0.0.1:11435 ollama serve` (and if this address is also in use, try to increment the numbers by one until you find an address not in use\n",
2303+
"\n",
2304+
"---"
2305+
]
2306+
},
2307+
{
2308+
"cell_type": "markdown",
2309+
"id": "747a2fc7-282d-47ec-a987-ed0a23ed6822",
2310+
"metadata": {
2311+
"id": "747a2fc7-282d-47ec-a987-ed0a23ed6822"
2312+
},
2313+
"source": [
22942314
"- With the ollama application or `ollama serve` running in a different terminal, on the command line, execute the following command to try out the 8-billion-parameter Llama 3 model (the model, which takes up 4.7 GB of storage space, will be automatically downloaded the first time you execute this command)\n",
22952315
"\n",
22962316
"```bash\n",
@@ -2475,6 +2495,8 @@
24752495
"def query_model(\n",
24762496
" prompt,\n",
24772497
" model=\"llama3\",\n",
2498+
" # If you used OLLAMA_HOST=127.0.0.1:11435 ollama serve\n",
2499+
" # update the address from 11434 to 11435\n",
24782500
" url=\"http://localhost:11434/api/chat\"\n",
24792501
"):\n",
24802502
" # Create the data payload as a dictionary\n",

0 commit comments

Comments
 (0)