Use correct sampling rate in chat template#43674
Merged
zucchini-nlp merged 2 commits intohuggingface:mainfrom Feb 2, 2026
Merged
Use correct sampling rate in chat template#43674zucchini-nlp merged 2 commits intohuggingface:mainfrom
zucchini-nlp merged 2 commits intohuggingface:mainfrom
Conversation
|
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. |
ebezzam
approved these changes
Feb 2, 2026
Contributor
ebezzam
left a comment
There was a problem hiding this comment.
Thanks for addressing this @zucchini-nlp!
It looks good to me, I don't see ChatTemplateLoadKwargs nor ProcessorChatTemplateKwargs used anywhere else so probably shouldn't be breaking. Is there any related test that can be checked?
Comment on lines
+1716
to
+1720
| if "sampling_rate" not in template_kwargs: | ||
| if hasattr(self, "feature_extractor") and hasattr(self.feature_extractor, "sampling_rate"): | ||
| template_kwargs["sampling_rate"] = self.feature_extractor.sampling_rate | ||
| else: | ||
| template_kwargs["sampling_rate"] = 16_000 |
|
|
||
|
|
||
| class ProcessorChatTemplateKwargs(ChatTemplateLoadKwargs, TokenizerChatTemplateKwargs, total=False): | ||
| class ProcessorChatTemplateKwargs(TokenizerChatTemplateKwargs, total=False): |
Contributor
There was a problem hiding this comment.
nice idea to merge together
Member
Author
yeah, the processor MixinTests have a |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes #43262
Supersedes #43273 and #43660
I don't think the prev PR will be updated by contributor, since it's a code agent PR. Also I am seeing that it attracts more code agents as long as the issue is open, so let's merge a fix here
I also made a small clean-up of
ChatTemplateKwargsand deleted unused/duplicate kwargs, as we discussed in above linked PR review comments