shiv1119's picture
Added Model
8a19bac verified
raw
history blame
377 Bytes
import requests
import json
response = requests.post("http://localhost:11434/api/generate", json={
"model": "mymodel",
"prompt": "Hello explain your one project",
"stream": True
}, stream=True)
for line in response.iter_lines():
if line:
data = json.loads(line.decode("utf-8"))
print(data.get("response", ""), end="", flush=True)