Skip to content

Commit 8139b1d

Browse files
[bugfix] use raw string for regexes when backslash is used (#1823)
SUMMARY: Resolves #1776 The `gemma3_example.py` script was not correctly escaping the `\` character in its regexes. This adds the `r"` prefix to the string, so that python knows it is a raw string that needs to be escaped, avoiding warnings. It appears to be isolated to this example, I couldn't find other regexes with `\` characters that weren't being properly escaped. TEST PLAN: Example runs successfully after changes. Signed-off-by: Brian Dellabetta <[email protected]>
1 parent 72bc6e3 commit 8139b1d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/multimodal_vision/gemma3_example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ def data_collator(batch):
3232
scheme="W4A16",
3333
ignore=[
3434
"lm_head",
35-
"re:model\.vision_tower.*",
36-
"re:model\.multi_modal_projector.*",
35+
r"re:model\.vision_tower.*",
36+
r"re:model\.multi_modal_projector.*",
3737
],
3838
),
3939
]

0 commit comments

Comments
 (0)