make task resumable (#2132)

### What problem does this PR solve?

### Type of change


- [x] Performance Improvement
This commit is contained in:
Kevin Hu
2024-08-28 14:06:27 +08:00
committed by GitHub
parent 074d4f5031
commit 5daed10136
4 changed files with 43 additions and 16 deletions

View File

@ -217,7 +217,7 @@ def chat(dialog, messages, stream=True, **kwargs):
answer = ""
for ans in chat_mdl.chat_streamly(prompt, msg[1:], gen_conf):
answer = ans
yield {"answer": answer, "reference": {}, "prompt": prompt}
yield {"answer": answer, "reference": {}}
yield decorate_answer(answer)
else:
answer = chat_mdl.chat(prompt, msg[1:], gen_conf)