We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6ce6551 commit ca94c60Copy full SHA for ca94c60
comps/llms/text-generation/vllm/llama_index/llm.py
@@ -57,13 +57,11 @@ def llm_generate(input: LLMParamsDoc):
57
if input.streaming:
58
59
def stream_generator():
60
- chat_response = ""
61
for text in llm.stream_complete(input.query):
62
- chat_response += text
63
- chunk_repr = repr(text.encode("utf-8"))
64
- yield f"data: {chunk_repr}\n\n"
+ output = text.text
+ yield f"data: {output}\n\n"
65
if logflag:
66
- logger.info(f"[llm - chat_stream] stream response: {chat_response}")
+ logger.info(f"[llm - chat_stream] stream response: {output}")
67
yield "data: [DONE]\n\n"
68
69
return StreamingResponse(stream_generator(), media_type="text/event-stream")
0 commit comments