Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix always None in text_generation output #2316

Merged
merged 1 commit into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/huggingface_hub/inference/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1998,6 +1998,7 @@ def text_generation(
parameters = {
"best_of": best_of,
"decoder_input_details": decoder_input_details,
"details": details,
"do_sample": do_sample,
"frequency_penalty": frequency_penalty,
"grammar": grammar,
Expand Down
1 change: 1 addition & 0 deletions src/huggingface_hub/inference/_generated/_async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2026,6 +2026,7 @@ async def text_generation(
parameters = {
"best_of": best_of,
"decoder_input_details": decoder_input_details,
"details": details,
"do_sample": do_sample,
"frequency_penalty": frequency_penalty,
"grammar": grammar,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,51 +1,58 @@
interactions:
- request:
body: '{"inputs": "test", "parameters": {"do_sample": false, "max_new_tokens":
1, "repetition_penalty": null, "return_full_text": false, "stop": [], "seed":
null, "temperature": null, "top_k": null, "top_p": null, "truncate": null, "typical_p":
null, "best_of": null, "watermark": false, "details": true, "decoder_input_details":
false}, "stream": true}'
body: '{"inputs": "test", "parameters": {"details": true, "do_sample": false,
"max_new_tokens": 1, "return_full_text": false, "stop": []}, "stream": true}'
headers:
Accept:
- '*/*'
Accept-Encoding:
- gzip, deflate
- gzip, deflate, br
Connection:
- keep-alive
Content-Length:
- '346'
- '147'
Content-Type:
- application/json
X-Amzn-Trace-Id:
- d4223ed6-5a44-46b9-80ef-793faea3aaa3
user-agent:
- unknown/None; hf_hub/0.16.0.dev0; python/3.10.6; torch/1.12.1; tensorflow/2.11.0;
- unknown/None; hf_hub/0.24.0.dev0; python/3.10.12; torch/2.2.1; tensorflow/2.15.0.post1;
fastcore/1.5.23
method: POST
uri: https://api-inference.huggingface.co/models/google/flan-t5-xxl
response:
body:
string: 'data:{"token":{"id":3,"text":" ","logprob":-2.0078125,"special":false},"generated_text":"","details":{"finish_reason":"length","generated_tokens":1,"seed":null}}
string: 'data:{"index":1,"token":{"id":3,"text":" ","logprob":-2.0078125,"special":false},"generated_text":"","details":{"finish_reason":"length","generated_tokens":1,"seed":null}}


'
headers:
Connection:
- keep-alive
Content-Length:
- '163'
Content-Type:
- text/event-stream
Date:
- Mon, 19 Jun 2023 15:22:09 GMT
- Wed, 05 Jun 2024 10:06:38 GMT
Transfer-Encoding:
- chunked
access-control-allow-credentials:
- 'true'
access-control-allow-origin:
- '*'
cache-control:
- no-cache
vary:
- Origin, Access-Control-Request-Method, Access-Control-Request-Headers
- origin, Origin, Access-Control-Request-Method, Access-Control-Request-Headers
x-accel-buffering:
- 'no'
x-compute-characters:
- '4'
x-compute-type:
- cache
- 2-a10-g
x-request-id:
- _72TkULJsztkhCE-ss7vX
- Wjh9U3f7tT4gtc6U1TbqU
x-sha:
- ad196ce8c46191d6a52592960835ff96d30152b5
- ae7c9136adc7555eeccc78cdd960dfd60fb346ce
status:
code: 200
message: OK
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
interactions:
- request:
body: '{"inputs": "test", "parameters": {"do_sample": false, "max_new_tokens":
1, "repetition_penalty": null, "return_full_text": false, "stop": [], "seed":
null, "temperature": null, "top_k": null, "top_p": null, "truncate": null, "typical_p":
null, "best_of": null, "watermark": false, "details": true, "decoder_input_details":
true}, "stream": false}'
body: '{"inputs": "test", "parameters": {"decoder_input_details": true, "details":
true, "do_sample": false, "max_new_tokens": 1, "return_full_text": false, "stop":
[]}, "stream": false}'
headers:
Accept:
- '*/*'
Accept-Encoding:
- gzip, deflate
- gzip, deflate, br
Connection:
- keep-alive
Content-Length:
- '346'
- '179'
Content-Type:
- application/json
X-Amzn-Trace-Id:
- 197c67b8-3fed-4e3a-bf8f-4f4ce1bf4a83
user-agent:
- unknown/None; hf_hub/0.16.0.dev0; python/3.10.6; torch/1.12.1; tensorflow/2.11.0;
- unknown/None; hf_hub/0.24.0.dev0; python/3.10.12; torch/2.2.1; tensorflow/2.15.0.post1;
fastcore/1.5.23
method: POST
uri: https://api-inference.huggingface.co/models/google/flan-t5-xxl
Expand All @@ -28,24 +28,42 @@ interactions:
headers:
Connection:
- keep-alive
Content-Length:
- '212'
Content-Type:
- application/json
Date:
- Mon, 19 Jun 2023 15:22:10 GMT
- Wed, 05 Jun 2024 10:04:17 GMT
Transfer-Encoding:
- chunked
access-control-allow-credentials:
- 'true'
access-control-allow-origin:
- '*'
vary:
- Origin, Access-Control-Request-Method, Access-Control-Request-Headers
- origin, Origin, Access-Control-Request-Method, Access-Control-Request-Headers
x-compute-characters:
- '4'
x-compute-time:
- '56'
- '0.064899795'
x-compute-type:
- cache
- 2-a10-g
x-generated-tokens:
- '1'
x-inference-time:
- '64'
x-prompt-tokens:
- '2'
x-queue-time:
- '0'
x-request-id:
- mYbIoIndwB6eIqjB5CNM5
- S1BqZrjWRZzJihJGnQV_i
x-sha:
- ad196ce8c46191d6a52592960835ff96d30152b5
- ae7c9136adc7555eeccc78cdd960dfd60fb346ce
x-time-per-token:
- '64'
x-total-time:
- '64'
x-validation-time:
- '0'
status:
code: 200
message: OK
Expand Down
Loading