-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: added a polyglot ollama notebook
- Loading branch information
Casper Bollen
authored and
Casper Bollen
committed
Mar 7, 2024
1 parent
e299f12
commit 9bb8360
Showing
2 changed files
with
111 additions
and
25 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# Ollama Lib Examples" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"metadata": { | ||
"dotnet_interactive": { | ||
"language": "fsharp" | ||
}, | ||
"polyglot_notebook": { | ||
"kernelName": "fsharp" | ||
} | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"#load \"load.fsx\"\n", | ||
"\n", | ||
"open Informedica.Ollama.Lib\n", | ||
"open Ollama.Operators" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## The hello world of LLMs" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"metadata": { | ||
"dotnet_interactive": { | ||
"language": "fsharp" | ||
}, | ||
"polyglot_notebook": { | ||
"kernelName": "fsharp" | ||
} | ||
}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"Starting conversation with openchat:7b\n", | ||
"\n", | ||
"Options:\n", | ||
"{\"num_keep\":null,\"seed\":101,\"num_predict\":null,\"top_k\":null,\"top_p\":null,\"tfs_z\":null,\"typical_p\":null,\"repeat_last_n\":64,\"temperature\":0.0,\"repeat_penalty\":null,\"presence_penalty\":null,\"frequency_penalty\":null,\"mirostat\":0,\"mirostat_tau\":null,\"mirostat_eta\":null,\"penalize_newline\":null,\"stop\":[],\"numa\":null,\"num_ctx\":2048,\"num_batch\":null,\"num_gqa\":null,\"num_gpu\":null,\"main_gpu\":null,\"low_vram\":null,\"f16_kv\":null,\"vocab_only\":null,\"use_mmap\":null,\"use_mlock\":null,\"rope_frequency_base\":null,\"rope_frequency_scale\":null,\"num_thread\":null}\n", | ||
"\n", | ||
"Got an answer\n", | ||
"\n", | ||
"## Question:\n", | ||
"You are a helpful assistant\n", | ||
"\n", | ||
"## Answer:\n", | ||
"It seems like you may have accidentally typed \"Correct\" instead of your intended message. If you could provide me with the correct information or clarify what you'd like assistance with, I'll be more than happy to help!\n", | ||
"\n", | ||
"\n", | ||
"\n", | ||
"## Question:\n", | ||
"Why is the sky blue?\n", | ||
"\n", | ||
"## Answer:\n", | ||
"The sky appears blue to us because of a phenomenon called Rayleigh scattering. When sunlight passes through Earth's atmosphere, it interacts with the molecules and particles in the air. These interactions cause the shorter wavelength colors (like violet and blue) to scatter more than the longer wavelength colors (like red and yellow).\n", | ||
"\n", | ||
"Our eyes are most sensitive to blue light, so we perceive the sky as blue when we look up at it. However, during sunrise and sunset, the sunlight has to travel through a larger portion of the atmosphere, causing even more scattering and allowing the longer wavelength colors (like reds and oranges) to dominate, resulting in the beautiful colors we see during these times.\n", | ||
"\n", | ||
"\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"\"You are a helpful assistant\"\n", | ||
"|> init Ollama.Models.``openchat:7b``\n", | ||
">>? \"Why is the sky blue?\"\n", | ||
"|> Ollama.Conversation.print\n" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": ".NET (F#)", | ||
"language": "F#", | ||
"name": ".net-fsharp" | ||
}, | ||
"language_info": { | ||
"name": "polyglot-notebook" | ||
}, | ||
"polyglot_notebook": { | ||
"kernelInfo": { | ||
"defaultKernelName": "fsharp", | ||
"items": [ | ||
{ | ||
"aliases": [], | ||
"languageName": "fsharp", | ||
"name": "fsharp" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |