forked from phoenix/litellm-mirror
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
|
## RESPONSE OBJECT
|
||||||
try:
|
try:
|
||||||
completion_response = response.json()
|
completion_response = response.json()
|
||||||
|
if isinstance(completion_response, dict):
|
||||||
|
completion_response: List[Dict[str, Any]] = [{"generated_text": content}]
|
||||||
except:
|
except:
|
||||||
import traceback
|
import traceback
|
||||||
raise HuggingfaceError(
|
raise HuggingfaceError(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue