Skip to content

[OutputRecorder] re.search on layer_name#45512

Open
eustlb wants to merge 3 commits intomainfrom
regex-output-recorder
Open

[OutputRecorder] re.search on layer_name#45512
eustlb wants to merge 3 commits intomainfrom
regex-output-recorder

Conversation

@eustlb
Copy link
Copy Markdown
Contributor

@eustlb eustlb commented Apr 19, 2026

What does this PR do?

As discussed in #44408, this adds the possibility to do regex matching for layer_name in the OutputRecorder.

OutputRecorder(GraniteSpeechConformerBlock, layer_name=r"layers\.(6|12|18)$")

Backward compatibillity:

re.search has the same behavior as substring in string except for patterns like layer_name=".attention" with the dot now matching Xattention. None of the layer_name in the lib trigger this edge case though, but I still updated them all to foster good practices

@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: blip, blip_2, decision_transformer, gpt2, instructblip, instructblipvideo, minimax, qwen3_omni_moe, qwen3_vl_moe, switch_transformers, vjepa2

@zvik
Copy link
Copy Markdown

zvik commented Apr 19, 2026

Maybe it will be better to add another option for regex instead of breaking other models:
See: main...zvik:transformers:output-recorder-regex

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