diff options
| author | Christian Krinitsin <mail@krinitsin.com> | 2025-05-26 12:09:04 +0200 |
|---|---|---|
| committer | Christian Krinitsin <mail@krinitsin.com> | 2025-05-26 12:09:04 +0200 |
| commit | 297fefffeb8f1f040cf48e57604785d4b7e364db (patch) | |
| tree | ae54d4dd1192175be16469c2b50f5096a957b6d6 /ollama/ollama.py | |
| parent | 6373e8d12fef4e235390f2014dca853d6bc6268c (diff) | |
| download | qemu-analysis-297fefffeb8f1f040cf48e57604785d4b7e364db.tar.gz qemu-analysis-297fefffeb8f1f040cf48e57604785d4b7e364db.zip | |
add ollama python script
Diffstat (limited to 'ollama/ollama.py')
| -rwxr-xr-x | ollama/ollama.py | 17 |
1 files changed, 17 insertions, 0 deletions
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") |