blob: ea183b39838196cbde5a67b80ca3bb343b881f31 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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")
|