Skip to content

Regex post processing in loading#43585

Merged
Cyrilvallez merged 7 commits intomainfrom
loading-regex-processing
Jan 29, 2026
Merged

Regex post processing in loading#43585
Cyrilvallez merged 7 commits intomainfrom
loading-regex-processing

Conversation

@Cyrilvallez
Copy link
Member

@Cyrilvallez Cyrilvallez commented Jan 29, 2026

What does this PR do?

The change introduced in #43261 with __setattr__ is quite dangerous, as source_patterns and target_patterns live together and cannot be unentangled from one another if there is a capturing group.
Thus, changing one with __setattr__ without changing the other, or simply changing the wrong one first can lead to very unexpected behavior and wrong pattern matching/replacing.
For this reason, it's better to reinstantiate an object directly in peft instead of switching the targets/sources.

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

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.

Fair enough! ty

@Cyrilvallez Cyrilvallez merged commit 3656b8b into main Jan 29, 2026
20 of 26 checks passed
@Cyrilvallez Cyrilvallez deleted the loading-regex-processing branch January 29, 2026 14:10
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