From da8c2f4a4ab03ca0ff53fc2fbc42f81bee95b1a4 Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Thu, 16 Nov 2023 11:59:56 -0800 Subject: [PATCH] (fix) HF api + streaming --- litellm/utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/litellm/utils.py b/litellm/utils.py index 74497c282d..a9f23656ec 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -4367,6 +4367,7 @@ class CustomStreamWrapper: def handle_huggingface_chunk(self, chunk): try: + chunk = chunk.decode("utf-8") # DO NOT REMOVE this: This is required for HF inference API + Streaming text = "" is_finished = False finish_reason = ""