MCPcopy Create free account
hub / github.com/modelscope/modelscope / test_patch_config

Method test_patch_config

tests/utils/test_hf_util.py:130–145  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

128 self.assertTrue(False)
129
130 def test_patch_config(self):
131 with patch_context():
132 from transformers import AutoConfig
133 config = AutoConfig.from_pretrained('Qwen/Qwen2.5-0.5B')
134 self.assertTrue(config is not None)
135 try:
136 AutoConfig.from_pretrained('Qwen/Qwen2.5-0.5B')
137 self.assertTrue(False)
138 except: # noqa
139 pass
140
141 # Test patch again
142 with patch_context():
143 from transformers import AutoConfig
144 config = AutoConfig.from_pretrained('Qwen/Qwen2.5-0.5B')
145 self.assertTrue(config is not None)
146
147 @unittest.skipUnless(test_level() >= 1, 'skip test in current test level')
148 def test_patch_diffusers(self):

Callers

nothing calls this directly

Calls 2

patch_contextFunction · 0.90
from_pretrainedMethod · 0.45

Tested by

no test coverage detected