(self)
| 115 | self.assertIsNotNone(model) |
| 116 | |
| 117 | def test_patch_model(self): |
| 118 | from modelscope.utils.hf_util.patcher import patch_context |
| 119 | with patch_context(): |
| 120 | from transformers import AutoModel |
| 121 | model = AutoModel.from_pretrained('Qwen/Qwen2.5-0.5B') |
| 122 | self.assertTrue(model is not None) |
| 123 | try: |
| 124 | model = AutoModel.from_pretrained('Qwen/Qwen2.5-0.5B') |
| 125 | except Exception: |
| 126 | pass |
| 127 | else: |
| 128 | self.assertTrue(False) |
| 129 | |
| 130 | def test_patch_config(self): |
| 131 | with patch_context(): |
nothing calls this directly
no test coverage detected