-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update conversational widget to use text-generation (+ remove `conver…
…sational` task) (#457) Done as part of huggingface-internal/moon-landing#8578. Should be merged before (or at the same time) as huggingface-internal/moon-landing#8723. This is only a first draft to check if we have everything we need. From huggingface-internal/moon-landing#8578: > In huggingface.js and api-inference > - [ ] Models that are secondary tagged as `conversational` will get the `ConversationalWidget` > - [ ] The `ConversationalWidget` will call the `text-generation` API under the hood. The widget needs to take care of all prompt formatting (using the recent jinja work in `huggingface.js`) > - [ ] Should we just kill the conversational API in the inference API with the APIs unification? > This would break use cases such as `pipeline("microsoft/DialoGPT-medium")` in `transformers` > > Result: > * All models with conversational capabilities will have a nice widget > * We eliminate the fragmentation of tasks (conversational vs text generation) > * We remove the confusing conv pipeline Currently in this PR: - ✔️ _Models that are secondary tagged as conversational will get the ConversationalWidget_ - ✔️ _The `ConversationalWidget` will call the `text-generation` API under the hood._ (automatic in inference API if `pipeline_tag` gets updated by huggingface-internal/moon-landing#8723) - ✔️ _The widget needs to take care of all prompt formatting_ (not complete) cc @xenova @osanseviero @SBrandeis @coyotte508 --- Still unsure how to proceed: - how to handle the transition period? => **EDIT:** no transition period - what to do if we don't have a `chat_template`? => **EDIT:** raise error - what if we have a `chat_template` but no `eos_token` / `bos_token`? => **EDIT:** should be ok - should we keep the `Conversation` structure in the widget (with `generated_responses` / `past_user_inputs` / `generated_text`) ? If not, would need more svelte expertise 😄 => **EDIT:** ok --------- Co-authored-by: Joshua Lochner <[email protected]> Co-authored-by: Julien Chaumond <[email protected]> Co-authored-by: Simon Brandeis <[email protected]>
- Loading branch information
1 parent
705588e
commit 802e164
Showing
24 changed files
with
176 additions
and
323 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 was deleted.
Oops, something went wrong.
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
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
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.