Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions tests/models/auto/test_modeling_auto.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,9 +579,10 @@ def test_model_with_dotted_name_and_relative_imports(self):
Test for issue #40496: AutoModel.from_pretrained() doesn't work for models with '.' in their name
when there's a relative import.
Without the fix, this raises: ModuleNotFoundError: No module named 'transformers_modules.test-model_v1'
Without the fix, this raises: ModuleNotFoundError:
No module named 'transformers_modules.hf-internal-testing.remote_code_model_with_dots_v1'
"""
model_id = "hf-internal-testing/remote_code_model_with_dots"
model_id = "hf-internal-testing/remote_code_model_with_dots_v1.0"

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