Skip to content

Generate: Add text streamer decoding options#22544

Merged
gante merged 2 commits into
huggingface:mainfrom
gante:streamer_kwargs
Apr 4, 2023
Merged

Generate: Add text streamer decoding options#22544
gante merged 2 commits into
huggingface:mainfrom
gante:streamer_kwargs

Conversation

@gante

@gante gante commented Apr 3, 2023

Copy link
Copy Markdown
Contributor

What does this PR do?

In advance of communicating the iterator streamer with Gradio demos, adds two important options:

  1. option to skip the prompt in the streamer (e.g. for chatbots)
  2. option to receive decode() kwargs (e.g. to skip special tokens)

It also makes use of the changes in #22516 to make the iterator streamer much more compact -- it is now a child class of the stdout streamer, with a few modifications.

@gante gante requested a review from sgugger April 3, 2023 18:54
@HuggingFaceDocBuilderDev

HuggingFaceDocBuilderDev commented Apr 3, 2023

Copy link
Copy Markdown

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

@sgugger sgugger left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@gante gante merged commit 1905384 into huggingface:main Apr 4, 2023
@gante gante deleted the streamer_kwargs branch April 4, 2023 08:06
raghavanone pushed a commit to raghavanone/transformers that referenced this pull request Apr 5, 2023
novice03 pushed a commit to novice03/transformers that referenced this pull request Jun 23, 2023
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.

3 participants