mirror of
https://github.com/dogkeeper886/ollama37.git
synced 2025-12-12 16:57:04 +00:00
Merge pull request #18 from jmorganca/yield-object
update generate to yield object
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import os
|
||||
import sys
|
||||
import json
|
||||
from pathlib import Path
|
||||
from argparse import ArgumentParser
|
||||
|
||||
@@ -71,7 +70,6 @@ def generate_oneshot(*args, **kwargs):
|
||||
print(flush=True)
|
||||
|
||||
for output in engine.generate(*args, **kwargs):
|
||||
output = json.loads(output)
|
||||
choices = output.get("choices", [])
|
||||
if len(choices) > 0:
|
||||
print(choices[0].get("text", ""), end="", flush=True)
|
||||
|
||||
Reference in New Issue
Block a user