fix(utils.py): fix streaming

This commit is contained in:
Krrish Dholakia 2024-02-26 12:52:53 -08:00
parent dfb1d34e26
commit 5b06627c09
3 changed files with 6 additions and 5 deletions

View file

@ -8705,7 +8705,7 @@ class CustomStreamWrapper:
model_response.model = self.model
print_verbose(
f"model_response finish reason 3: {model_response.choices[0].finish_reason}"
f"model_response finish reason 3: {model_response.choices[0].finish_reason}; response_obj={response_obj}"
)
## FUNCTION CALL PARSING
if (
@ -8773,11 +8773,11 @@ class CustomStreamWrapper:
## RETURN ARG
if (
response_obj.get("text", None) is not None
completion_obj["content"] is not None
or response_obj.get("original_chunk", None) is not None
):
hold = False
if response_obj.get("content", None) is not None:
if completion_obj["content"] is not None:
hold, model_response_str = self.check_special_tokens(
chunk=completion_obj["content"],
finish_reason=model_response.choices[0].finish_reason,