Skip to content

Conversation

@zucchini-nlp
Copy link
Member

@zucchini-nlp zucchini-nlp commented Oct 17, 2025

What does this PR do?

Disentangles config and generation config. Now the model's config will throw an error if generation params are found. To keep BC, we'll still be loading models from the hub where generation params are in config, but we'll manually drop these params from being set as an attribute.

@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.

url = "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-Audio/glass-breaking-151256.mp3"
audio, sr = librosa.load(BytesIO(urlopen(url).read()), sr=processor.feature_extractor.sampling_rate)
inputs = processor(text=prompt, audios=audio, return_tensors="pt").to(model.device)
inputs = processor(text=prompt, audio=audio, return_tensors="pt").to(model.device)
Copy link
Member Author

Choose a reason for hiding this comment

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

Audio renaming is not related, accidentally slipped from another branch. I'll rebase main after #41681 is merged

@zucchini-nlp zucchini-nlp changed the title Delete generation params from model config 🚨 Delete generation params from model config Nov 17, 2025
@zucchini-nlp
Copy link
Member Author

cc @vasqu maybe since Joao left and I need someone to help merge generation PRs. This one particularly is blocking me. I'd love to clean-up and break BC for v5, since generation config is too complicated at this point

This PR particularly splits generation config away from model config, a dependency we had for a few ages due to legacy reasons. It's time to move on I think and raise a ValueError if users add manually generation params in a model config

NOTE: bad formatted configs from hub can still be loaded for BC

@zucchini-nlp zucchini-nlp requested a review from vasqu November 17, 2025 15:17
Copy link
Contributor

@vasqu vasqu left a comment

Choose a reason for hiding this comment

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

I'm in general aligned with this, just have a few nits/questions just to be sure.

Don't forget

  • the bad audio(s)
  • v5 tag and add it to the issue

zucchini-nlp and others added 2 commits November 17, 2025 17:18
Co-authored-by: Anton Vlasjuk <73884904+vasqu@users.noreply.github.com>
Co-authored-by: Anton Vlasjuk <73884904+vasqu@users.noreply.github.com>
Copy link
Contributor

@vasqu vasqu left a comment

Choose a reason for hiding this comment

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

Thx, lgtm

Time to merge with main and check conflicts 👀 just the same things as I said before re audios + v5

@github-actions
Copy link
Contributor

[For maintainers] Suggested jobs to run (before merge)

run-slow: bart, encoder_decoder, mvp, rag, speech_encoder_decoder, udop, vision_encoder_decoder

@zucchini-nlp
Copy link
Member Author

Rebased main, now the diff has no audio-related changes. Added the v5 tag and a rotation light as it's a bit breaking. Merging

@zucchini-nlp zucchini-nlp merged commit b1bdf9c into huggingface:main Nov 18, 2025
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants