-
Notifications
You must be signed in to change notification settings - Fork 761
[Bot] Update inference types #3104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
7f293e7
to
8990983
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3104 +/- ##
===========================================
- Coverage 76.33% 57.12% -19.21%
===========================================
Files 130 134 +4
Lines 12952 13293 +341
===========================================
- Hits 9887 7594 -2293
- Misses 3065 5699 +2634 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
7db22ba
to
32628dd
Compare
47ec62d
to
85374f2
Compare
53f15af
to
ab506b6
Compare
Opened huggingface/huggingface.js#1537 and #3167 to finally fix the chat completion discrepancies. Once merged, we will get back to a "normal" PR with only text-to-video stuff. |
69e7ebd
to
5a7d328
Compare
5a7d328
to
152ebf8
Compare
In huggingface/huggingface_hub#3082 @hanouticelina fixed the Python inference types for chat completion grammar input. Biggest update was: ```py @dataclass_with_extra class ChatCompletionInputResponseFormatText(BaseInferenceType): type: Literal["text"] @dataclass_with_extra class ChatCompletionInputResponseFormatJSONSchema(BaseInferenceType): type: Literal["json_schema"] json_schema: ChatCompletionInputJSONSchema @dataclass_with_extra class ChatCompletionInputResponseFormatJSONObject(BaseInferenceType): type: Literal["json_object"] ChatCompletionInputGrammarType = Union[ ChatCompletionInputResponseFormatText, ChatCompletionInputResponseFormatJSONSchema, ChatCompletionInputResponseFormatJSONObject, ] ``` --- This PR reflects "officially" this update in the JS specs. It makes JS and Python specs aligned again (was not the case for the last month, ending up with annoying PRs like this one huggingface/huggingface_hub#3104). The result is not as satisfying as what a manual implementation would give because the 3 objects are merged in 1 with optional fields (see `export type ChatCompletionInputGrammarTypeType = "text" | "json_schema" | "json_object";`). This is because quicktype do not handle properly unions (see glideapps/quicktype#1266 - 6 yo :confused: ). It's not the only case like this in our specs but first time I find out about it. Not a problem since we don't enforce data structures. In Python, the data structure will result in this: huggingface/huggingface_hub#3167
8b59498
to
7da279c
Compare
46de283
to
9212cb7
Compare
870f0c6
to
53be813
Compare
001d86d
to
6c3e0d7
Compare
6c3e0d7
to
a899310
Compare
waiting for #3231 to be merged first |
This PR updates the inference types. It has been generated by running:
This PR was automatically created by the Update Inference Types workflow.
Make sure the changes are correct before merging.