mirror of
https://github.com/ollama/ollama-python.git
synced 2026-05-01 11:48:17 +08:00
add stream=True
This commit is contained in:
parent
23a46bf854
commit
3b33dd3bf4
@ -7,7 +7,7 @@ from ollama import generate
|
||||
prompt = 'a sunset over mountains'
|
||||
print(f'Prompt: {prompt}')
|
||||
|
||||
for response in generate(model='x/z-image-turbo', prompt=prompt):
|
||||
for response in generate(model='x/z-image-turbo', prompt=prompt, stream=True):
|
||||
if response.image:
|
||||
# Final response contains the image
|
||||
with open('output.png', 'wb') as f:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user