Skip to content

Commit

Permalink
chore: added a polyglot ollama notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
Casper Bollen authored and Casper Bollen committed Mar 7, 2024
1 parent e299f12 commit 9bb8360
Show file tree
Hide file tree
Showing 2 changed files with 111 additions and 25 deletions.
25 changes: 0 additions & 25 deletions src/Informedica.Ollama.Lib/Notebooks/Examples.ipynb

This file was deleted.

111 changes: 111 additions & 0 deletions src/Informedica.Ollama.Lib/Notebooks/Examplles.ipynb
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
}

0 comments on commit 9bb8360

Please sign in to comment.