-
Notifications
You must be signed in to change notification settings - Fork 570
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add table question answering to inference client (#1612)
* dd table question answering to inference client * Change in line with review points on other PRs * typo * make style --------- Co-authored-by: Lucain Pouget <lucainp@gmail.com>
- Loading branch information
1 parent
e98ada3
commit 0fbbf6b
Showing
6 changed files
with
189 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
tests/cassettes/InferenceClientVCRTest.test_table_question_answering.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
interactions: | ||
- request: | ||
body: '{"query": "How many stars does the transformers repository have?", "table": | ||
{"Repository": ["Transformers", "Datasets", "Tokenizers"], "Stars": ["36542", | ||
"4512", "3934"]}}' | ||
headers: | ||
Accept: | ||
- '*/*' | ||
Accept-Encoding: | ||
- gzip, deflate, br | ||
Connection: | ||
- keep-alive | ||
Content-Length: | ||
- '171' | ||
Content-Type: | ||
- application/json | ||
X-Amzn-Trace-Id: | ||
- 98fa539e-9908-4f3f-864c-94e56277e54b | ||
user-agent: | ||
- unknown/None; hf_hub/0.17.0.dev0; python/3.10.12; torch/2.0.0.post101 | ||
method: POST | ||
uri: https://api-inference.huggingface.co/models/google/tapas-base-finetuned-wtq | ||
response: | ||
body: | ||
string: '{"answer":"AVERAGE > 36542","coordinates":[[0,1]],"cells":["36542"],"aggregator":"AVERAGE"}' | ||
headers: | ||
Connection: | ||
- keep-alive | ||
Content-Type: | ||
- application/json | ||
Date: | ||
- Tue, 05 Sep 2023 22:14:00 GMT | ||
Transfer-Encoding: | ||
- chunked | ||
access-control-allow-credentials: | ||
- 'true' | ||
access-control-expose-headers: | ||
- x-compute-type, x-compute-time | ||
server: | ||
- uvicorn | ||
vary: | ||
- Origin, Access-Control-Request-Method, Access-Control-Request-Headers | ||
x-compute-characters: | ||
- '96' | ||
x-compute-time: | ||
- '0.056' | ||
x-compute-type: | ||
- cpu | ||
x-request-id: | ||
- qQfAM1RLCDKDAJYuavdEW | ||
x-sha: | ||
- e3dde1905dea877b0df1a5c057533e48327dee77 | ||
status: | ||
code: 200 | ||
message: OK | ||
version: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters