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

[Chat] Add Chat from TRL 🐈 #35714

Merged
merged 7 commits into from
Jan 22, 2025
Merged

[Chat] Add Chat from TRL 🐈 #35714

merged 7 commits into from
Jan 22, 2025

Conversation

gante
Copy link
Member

@gante gante commented Jan 15, 2025

What does this PR do?

Adds a chat command, allowing users to explore text models with a minimal effort. Except for the transformers-specific command boilerplate, this chat is a copy of the chat in TRL.

The purpose of this PR is to establish a baseline from something that already works well. In subsequent PRs, a few QoL upgrades will be added to this chat, including:

  • Documentation in transformers
  • Allowing any flag in GenerationConfig to be set
  • Allowing a generation_config.json file to parameterize the chat, and allow users to export current chat settings into files
  • Bring performance optimization tricks and settings presets from local-gemma, including compilation
  • Allow files as input, for ASR models and VLMs

Usage

  1. checkout to this PR
  2. transformers-cli chat --model_name_or_path Qwen/Qwen2.5-0.5B-Instruct
  3. for full list of commands: transformers-cli chat --help
  4. for help while chatting, type help

@HuggingFaceDocBuilderDev

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.

@gante gante changed the title [Chat] Add Chat from TRL [Chat] Add Chat from TRL 🐈 Jan 16, 2025
@gante gante removed the request for review from Rocketknight1 January 20, 2025 15:50
Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

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

Super nice! Just missing documentation IMO and maybe some examples of actually calling the CLI! 🤗

@gante
Copy link
Member Author

gante commented Jan 22, 2025

@ArthurZucker I've added docs, but the preview isn't showing them 🤔 I'm merging and then I'll check the docs on main to see if it needs some corrections

@gante gante merged commit b3d6722 into huggingface:main Jan 22, 2025
13 checks passed
@gante gante deleted the chat branch January 22, 2025 13:30
@gante gante mentioned this pull request Jan 22, 2025
bursteratom pushed a commit to bursteratom/transformers that referenced this pull request Jan 31, 2025
* tmp commit

* add working chat

* add docts

* docs 2

* use auto dtype by default
elvircrn pushed a commit to elvircrn/transformers that referenced this pull request Feb 13, 2025
* tmp commit

* add working chat

* add docts

* docs 2

* use auto dtype by default
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