Skip to content

Commit 19d350c

Browse files
committed
api
1 parent 2e77f3a commit 19d350c

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

_unittests/ut_torch_models/test_hghub_api.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,15 @@ def test_download_code_modelid(self):
162162
self.assertEqual(
163163
["configuration_phimoe.py", "modeling_phimoe.py", "sample_finetune.py"], pyf
164164
)
165-
cls = transformers.dynamic_module_utils.get_class_from_dynamic_module(
166-
"modeling_phimoe.Phi4MMImageEmbedding",
167-
pretrained_model_name_or_path=os.path.split(files[0])[0],
168-
)
165+
try:
166+
cls = transformers.dynamic_module_utils.get_class_from_dynamic_module(
167+
"modeling_phimoe.Phi4MMImageEmbedding",
168+
pretrained_model_name_or_path=os.path.split(files[0])[0],
169+
)
170+
except ImportError as e:
171+
if "flash_attn" in str(e):
172+
raise unittest.SkipTest("missing package {e}")
173+
raise
169174
self.assertEqual(cls.__name__, "Phi4MMImageEmbedding")
170175

171176

0 commit comments

Comments
 (0)