Skip to content
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

Add support for Blenderbot and BlenderbotSmall (Closes #37, #29) #292

Merged
merged 10 commits into from
Sep 19, 2023

Conversation

xenova
Copy link
Collaborator

@xenova xenova commented Sep 11, 2023

Had a few hours over the weekend, so I decided to knock this issue out. It hasn't been a major priority simply because these models are outdated and there are better alternatives. The hope is that later versions of blenderbot are released (and added to transformers; see here) and this can serve as a starting point for adding support for those.

NOTE Despite having similar names, there are significant differences between the Blenderbot and BlenderbotSmall tokenizers. The current BlenderbotSmallTokenizerFast is broken in the python library, so there are some slightly hacky and non-standard approaches taken to get it working. See Xenova/blenderbot_small-90M for more information.

Example usage:

Blenderbot

let generator = await pipeline('text2text-generation', 'Xenova/blenderbot-400M-distill');
let output = await generator('What is your name?', { num_beams: 1 });
console.log(output)
// [ ' My name is Jessica.' ]

BlenderbotSmall

let generator = await pipeline('text2text-generation', 'Xenova/blenderbot_small-90M');
let output = await generator('What is your name?', { num_beams: 1 });
console.log(output)
// [ 'my name is sam.' ]

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Sep 11, 2023

The documentation is not available anymore as the PR was closed or merged.

@xenova xenova merged commit c367f9d into main Sep 19, 2023
4 checks passed
@xenova xenova deleted the blenderbot branch July 10, 2024 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants