mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-08-17 07:47:25 +00:00
Merge remote-tracking branch 'origin/new-page-framework' into llm_framework
This commit is contained in:
commit
ba48fa3e08
@ -281,7 +281,7 @@ async def stream_generator(chat):
|
||||
)
|
||||
msg = msg.replace("\n", "\\n")
|
||||
yield f"data:{msg}\n\n"
|
||||
await asyncio.sleep(0.1)
|
||||
await asyncio.sleep(0.02)
|
||||
else:
|
||||
for chunk in model_response:
|
||||
if chunk:
|
||||
@ -291,7 +291,7 @@ async def stream_generator(chat):
|
||||
|
||||
msg = msg.replace("\n", "\\n")
|
||||
yield f"data:{msg}\n\n"
|
||||
await asyncio.sleep(0.1)
|
||||
await asyncio.sleep(0.02)
|
||||
|
||||
chat.current_message.add_ai_message(msg)
|
||||
chat.current_message.add_view_message(msg)
|
||||
|
@ -172,7 +172,8 @@ class BaseChat(ABC):
|
||||
from pilot.server.llmserver import worker
|
||||
output = worker.generate_stream_gate(payload)
|
||||
for rsp in output:
|
||||
rsp_str = str(rsp, "utf-8")
|
||||
rsp = rsp.replace(b"\0", b"")
|
||||
rsp_str = rsp.decode()
|
||||
print("[TEST: output]:", rsp_str)
|
||||
|
||||
### output parse
|
||||
|
Loading…
Reference in New Issue
Block a user