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

Method test_patch_diffusers

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

Source from the content-addressed store, hash-verified

146
147 @unittest.skipUnless(test_level() >= 1, 'skip test in current test level')
148 def test_patch_diffusers(self):
149 with patch_context():
150 from diffusers import StableDiffusionPipeline
151 pipe = StableDiffusionPipeline.from_pretrained(
152 'AI-ModelScope/stable-diffusion-v1-5')
153 self.assertTrue(pipe is not None)
154 try:
155 pipe = StableDiffusionPipeline.from_pretrained(
156 'AI-ModelScope/stable-diffusion-v1-5')
157 except Exception:
158 pass
159 else:
160 self.assertTrue(False)
161
162 from modelscope import StableDiffusionPipeline
163 pipe = StableDiffusionPipeline.from_pretrained(
164 'AI-ModelScope/stable-diffusion-v1-5')
165 self.assertTrue(pipe is not None)
166
167 @unittest.skipUnless(test_level() >= 1, 'skip test in current test level')
168 def test_patch_peft(self):

Callers

nothing calls this directly

Calls 2

patch_contextFunction · 0.90
from_pretrainedMethod · 0.45

Tested by

no test coverage detected