mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 11:43:54 +00:00
(fix) only decode chunk when it's not a str
This commit is contained in:
parent
95642df0a4
commit
55a054f3f6
1 changed files with 2 additions and 1 deletions
|
@ -4367,7 +4367,8 @@ class CustomStreamWrapper:
|
||||||
|
|
||||||
def handle_huggingface_chunk(self, chunk):
|
def handle_huggingface_chunk(self, chunk):
|
||||||
try:
|
try:
|
||||||
chunk = chunk.decode("utf-8") # DO NOT REMOVE this: This is required for HF inference API + Streaming
|
if type(chunk) != str:
|
||||||
|
chunk = chunk.decode("utf-8") # DO NOT REMOVE this: This is required for HF inference API + Streaming
|
||||||
text = ""
|
text = ""
|
||||||
is_finished = False
|
is_finished = False
|
||||||
finish_reason = ""
|
finish_reason = ""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue