Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 24, 2025
1 parent 4f45127 commit 947d339
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion comps/llms/src/doc-summarization/integrations/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,11 @@ async def generate(self, input: DocSumChatCompletionRequest, client):
if input.stream:

import json

from langserve.serialization import WellKnownLCSerializer

_serializer = WellKnownLCSerializer()

def extract_llm_tokens(stream_output):
op_data = _serializer.dumps({"ops": stream_output.ops}).decode("utf-8")
logger.info(op_data)
Expand All @@ -211,7 +214,7 @@ async def stream_generator():

if logflag:
logger.info(data)
if data != '':
if data != "":
yield f"data: {data}\n\n"
yield "data: [DONE]\n\n"

Expand Down

0 comments on commit 947d339

Please sign in to comment.