You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and dots ('.'), can be up to 35 characters long. Letters must be lowercase.
17 lines
391 B
17 lines
391 B
import ollama |
|
|
|
# Call chat with stream=True to enable streaming |
|
stream = ollama.chat( |
|
model='llama3:8b', |
|
messages=[ |
|
{ |
|
'role': 'user', |
|
'content': 'Hello, could you make a presentation of your self', |
|
} |
|
], |
|
stream=True |
|
) |
|
|
|
# Process the streamed response chunks |
|
for chunk in stream: |
|
print(chunk['message']['content'], end='', flush=True) |