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

Method test_transformer_patch

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

Source from the content-addressed store, hash-verified

107 self.assertTrue(tokenizer is not None)
108
109 def test_transformer_patch(self):
110 with patch_context():
111 from transformers import AutoTokenizer, AutoModelForCausalLM
112 tokenizer = AutoTokenizer.from_pretrained('Qwen/Qwen2.5-0.5B')
113 self.assertIsNotNone(tokenizer)
114 model = AutoModelForCausalLM.from_pretrained('Qwen/Qwen2.5-0.5B')
115 self.assertIsNotNone(model)
116
117 def test_patch_model(self):
118 from modelscope.utils.hf_util.patcher import patch_context

Callers

nothing calls this directly

Calls 2

patch_contextFunction · 0.90
from_pretrainedMethod · 0.45

Tested by

no test coverage detected