From 297fefffeb8f1f040cf48e57604785d4b7e364db Mon Sep 17 00:00:00 2001 From: Christian Krinitsin Date: Mon, 26 May 2025 12:09:04 +0200 Subject: add ollama python script --- ollama/ollama.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 ollama/ollama.py (limited to 'ollama/ollama.py') diff --git a/ollama/ollama.py b/ollama/ollama.py new file mode 100755 index 000000000..ea183b398 --- /dev/null +++ b/ollama/ollama.py @@ -0,0 +1,17 @@ +from ollama import chat, ChatResponse + +model = "deepseek-r1:70b" + +response: ChatResponse = chat( + model=model, messages=[ + { + 'role': 'user', + 'content': 'Hello, how are you?', + } + ], + stream=True +) + +for chunk in response: + print(chunk['message']['content'], end='', flush=True) +print("\n") -- cgit 1.4.1