diff --git a/litellm/llms/huggingface_restapi.py b/litellm/llms/huggingface_restapi.py index e945242bf2..e66627cccf 100644 --- a/litellm/llms/huggingface_restapi.py +++ b/litellm/llms/huggingface_restapi.py @@ -630,8 +630,12 @@ class Huggingface(BaseLLM): custom_llm_provider="huggingface", logging_obj=logging_obj, ) - async for transformed_chunk in streamwrapper: - yield transformed_chunk + + async def generator(): + async for transformed_chunk in streamwrapper: + yield transformed_chunk + + return generator() def embedding( self,