mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-09-11 04:14:52 +00:00
fixes fatal error in generate()
When using the non-streaming endpoint, the payload is not returned as a list of dictionaries, but as a single dictionary. Trying to index into it raises a `KeyError`. The fix is to simply remove the index operation and unpack the payload directly.
This commit is contained in:
parent
4139054b82
commit
c74c7fc65b
@ -154,7 +154,7 @@ class Client:
|
||||
payload = resp.json()
|
||||
if resp.status_code != 200:
|
||||
raise parse_error(resp.status_code, payload)
|
||||
return Response(**payload[0])
|
||||
return Response(**payload)
|
||||
|
||||
def generate_stream(
|
||||
self,
|
||||
|
Loading…
Reference in New Issue
Block a user