huggingface.js icon indicating copy to clipboard operation
huggingface.js copied to clipboard

[Feature Request] Allow using TextGenerationWidget in place of ConversationalWidget when needed

Open felladrin opened this issue 1 year ago • 2 comments

Hi all,

Thank you for the ConversationalWidget addition. It's working great for my chat models. But I'd like to ask if you could add a way to set a repository to use TextGenerationWidget in place of ConversationalWidget when needed.

By the code, it doesn't seem to be possible, considering the "conversational" tag is added automatically. https://github.com/huggingface/huggingface.js/blob/0b90595c32ee0eb38f503c80cc96d14aee3875be/packages/widgets/src/lib/components/InferenceWidget/InferenceWidget.svelte#L81-L86

My use case is this base model, which has the "chat_template" because it is intended to be a foundation for chat models using ChatML, but at the same time, half of its pretraining was focused on text-completion; so it's not that good at chat, and for this reason, I'd prefer it displaying the TextGenerationWidget.


Another option would be removing the "conversational" tag from it, is there any way to do it by editing the Readme?

The current Readme is overriding the "tags", image

but even so, the "conversational" tag is there. image

felladrin avatar Feb 29 '24 15:02 felladrin

cc @julien-c @osanseviero

coyotte508 avatar Feb 29 '24 15:02 coyotte508

we could add a widget_type optional override in the metadata if we wanted

julien-c avatar Feb 29 '24 15:02 julien-c