fix(huggingface_restapi.py): catch streaming errors

This commit is contained in:
Krrish Dholakia
2024-02-15 20:55:21 -08:00
parent eb45df16f1
commit 0bf35b4a91
+6 -2
View File
@@ -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,