mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-24 18:24:20 +00:00
fix(huggingface_restapi.py): handle generate text output
This commit is contained in:
parent
f4dcff2864
commit
a89b8f55e3
1 changed files with 2 additions and 0 deletions
|
@ -405,6 +405,8 @@ class Huggingface(BaseLLM):
|
|||
## RESPONSE OBJECT
|
||||
try:
|
||||
completion_response = response.json()
|
||||
if isinstance(completion_response, dict):
|
||||
completion_response: List[Dict[str, Any]] = [{"generated_text": content}]
|
||||
except:
|
||||
import traceback
|
||||
raise HuggingfaceError(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue