Skip to content

Commit b4428d5

Browse files
authored
Fix test for model with dotted name and relative imports (#41343)
1 parent 0464d9e commit b4428d5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/models/auto/test_modeling_auto.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -579,9 +579,10 @@ def test_model_with_dotted_name_and_relative_imports(self):
579579
Test for issue #40496: AutoModel.from_pretrained() doesn't work for models with '.' in their name
580580
when there's a relative import.
581581
582-
Without the fix, this raises: ModuleNotFoundError: No module named 'transformers_modules.test-model_v1'
582+
Without the fix, this raises: ModuleNotFoundError:
583+
No module named 'transformers_modules.hf-internal-testing.remote_code_model_with_dots_v1'
583584
"""
584-
model_id = "hf-internal-testing/remote_code_model_with_dots"
585+
model_id = "hf-internal-testing/remote_code_model_with_dots_v1.0"
585586

586587
model = AutoModel.from_pretrained(model_id, trust_remote_code=True)
587588
self.assertIsNotNone(model)

0 commit comments

Comments
 (0)