-
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 translation to inference client (#1608)
* Add translation to inference client * Corrected typo * Refactor in line with review points on related PRs * Change in line with review points on other PRs --------- Co-authored-by: Lucain Pouget <lucainp@gmail.com>
- Loading branch information
1 parent
c716714
commit e6f6760
Showing
5 changed files
with
128 additions
and
1 deletion.
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
48 changes: 48 additions & 0 deletions
48
tests/cassettes/InferenceClientVCRTest.test_translation.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,48 @@ | ||
interactions: | ||
- request: | ||
body: '{"inputs": "Hello world"}' | ||
headers: | ||
Accept: | ||
- '*/*' | ||
Accept-Encoding: | ||
- gzip, deflate, br | ||
Connection: | ||
- keep-alive | ||
Content-Length: | ||
- '25' | ||
Content-Type: | ||
- application/json | ||
X-Amzn-Trace-Id: | ||
- 4a43b00f-51f2-4e1a-86ba-92e4606509be | ||
user-agent: | ||
- unknown/None; hf_hub/0.17.0.dev0; python/3.10.12 | ||
method: POST | ||
uri: https://api-inference.huggingface.co/models/t5-small | ||
response: | ||
body: | ||
string: '[{"translation_text":"Hallo Welt"}]' | ||
headers: | ||
Connection: | ||
- keep-alive | ||
Content-Length: | ||
- '35' | ||
Content-Type: | ||
- application/json | ||
Date: | ||
- Sun, 20 Aug 2023 14:32:31 GMT | ||
access-control-allow-credentials: | ||
- 'true' | ||
vary: | ||
- Origin, Access-Control-Request-Method, Access-Control-Request-Headers | ||
x-compute-time: | ||
- '0.084' | ||
x-compute-type: | ||
- cache | ||
x-request-id: | ||
- FcgAtoJb-BUKbk49I4_Km | ||
x-sha: | ||
- df1b051c49625cf57a3d0d8d3863ed4d13564fe4 | ||
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