mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-08-13 14:06:43 +00:00
fix: next-ui output
This commit is contained in:
parent
eae38931fa
commit
40b55a2d27
@ -76,7 +76,13 @@ def proxyllm_generate_stream(model, tokenizer, params, device, context_len=2048)
|
|||||||
for line in res.iter_lines():
|
for line in res.iter_lines():
|
||||||
if line:
|
if line:
|
||||||
decoded_line = line.decode("utf-8")
|
decoded_line = line.decode("utf-8")
|
||||||
json_line = json.loads(decoded_line)
|
try:
|
||||||
print(json_line)
|
json_line = json.loads(decoded_line)
|
||||||
text += json_line["choices"][0]["message"]["content"]
|
print(json_line)
|
||||||
yield text
|
text += json_line["choices"][0]["message"]["content"]
|
||||||
|
yield text
|
||||||
|
except Exception as e:
|
||||||
|
text += decoded_line
|
||||||
|
yield json.loads(text)["choices"][0]["message"]["content"]
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user