Skip to content

🚨 Remove Group Beam Search decoding strategy#40495

Merged
manueldeprada merged 6 commits intohuggingface:mainfrom
manueldeprada:remove-group-bs
Sep 1, 2025
Merged

🚨 Remove Group Beam Search decoding strategy#40495
manueldeprada merged 6 commits intohuggingface:mainfrom
manueldeprada:remove-group-bs

Conversation

@manueldeprada
Copy link
Copy Markdown
Contributor

@manueldeprada manueldeprada commented Aug 27, 2025

Removes Group Beam Search generation strategy from the codebase. Directs users to the transformers-community/group-beam-search repository.

It has been a warning for a few releases, but now trust_remote_code=True is required to run group beam search.

Depends on #40480

@manueldeprada manueldeprada requested a review from gante August 27, 2025 14:02
"exponential_decay_length_penalty": None,
"suppress_tokens": None,
"begin_suppress_tokens": None,
# Deprecated arguments (moved to the Hub). TODO joao, manuel: remove in v4.62.0
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Note that if we remove this, initializing config arguments on the model will stop working, as in

model = BartForConditionalGeneration.from_pretrained(
"hf-internal-testing/tiny-random-bart",
max_length=10,
num_beams=2,
num_beam_groups=2,
num_return_sequences=2,
diversity_penalty=1.0,
eos_token_id=None,
return_dict_in_generate=True,
output_scores=True,
length_penalty=0.0,
)

"hf-internal-testing/tiny-random-bart",
eos_token_id=None,
)
generation_config = GenerationConfig(
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I moved the gen args to a gen config instead of model config, see previous comment.

@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

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.

@github-actions
Copy link
Copy Markdown
Contributor

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

run-slow: csm, dia, janus, musicgen, musicgen_melody, recurrent_gemma, rwkv

@manueldeprada
Copy link
Copy Markdown
Contributor Author

build-doc

@github-actions
Copy link
Copy Markdown
Contributor

Copy link
Copy Markdown
Contributor

@gante gante left a comment

Choose a reason for hiding this comment

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

(from a quick glance, the changes are the same as in the CS PR, which I already approved)

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