From 101b9249f840e3a8075c0829dbc8a5e07db57b5c Mon Sep 17 00:00:00 2001 From: Yingda Chen Date: Thu, 5 Dec 2024 09:26:34 +0800 Subject: [PATCH 1/2] fix missing import (#1126) Co-authored-by: Yingda Chen --- modelscope/hub/utils/caching.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modelscope/hub/utils/caching.py b/modelscope/hub/utils/caching.py index 993fb1cd..e1dcf83b 100644 --- a/modelscope/hub/utils/caching.py +++ b/modelscope/hub/utils/caching.py @@ -7,7 +7,8 @@ import tempfile from shutil import move, rmtree from typing import Dict -from modelscope.hub.constants import FILE_HASH +from modelscope.hub.constants import ( # noqa + FILE_HASH, MODELSCOPE_ENABLE_DEFAULT_HASH_VALIDATION) from modelscope.hub.utils.utils import compute_hash from modelscope.utils.logger import get_logger From d2ef1003ea4266c3a438361ec091bbcbcd34af66 Mon Sep 17 00:00:00 2001 From: tastelikefeet <58414341+tastelikefeet@users.noreply.github.com> Date: Thu, 5 Dec 2024 20:07:32 +0800 Subject: [PATCH 2/2] Skip obsolete sd pipeline (#1131) --- .../multi_modal/efficient_diffusion_tuning_pipeline.py | 4 +++- tests/pipelines/test_efficient_diffusion_tuning.py | 10 +++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/modelscope/pipelines/multi_modal/efficient_diffusion_tuning_pipeline.py b/modelscope/pipelines/multi_modal/efficient_diffusion_tuning_pipeline.py index 1b791634..320d83e7 100644 --- a/modelscope/pipelines/multi_modal/efficient_diffusion_tuning_pipeline.py +++ b/modelscope/pipelines/multi_modal/efficient_diffusion_tuning_pipeline.py @@ -36,8 +36,10 @@ class EfficientDiffusionTuningPipeline(Pipeline): 'data/test/images/vision_efficient_tuning_test_1.png') >>> print(f'Output: {result}.') """ + logger.warn( + '[NOTE]Do not use this pipeline because the dependencies are too old, ' + 'use https://github.com/modelscope/DiffSynth-Studio instead') super().__init__(model=model, **kwargs) - self.device = 'cuda' if torch.cuda.is_available() else 'cpu' self.model = self.model.to(self.device) self.model.eval() diff --git a/tests/pipelines/test_efficient_diffusion_tuning.py b/tests/pipelines/test_efficient_diffusion_tuning.py index 1f224917..af52d65f 100644 --- a/tests/pipelines/test_efficient_diffusion_tuning.py +++ b/tests/pipelines/test_efficient_diffusion_tuning.py @@ -11,10 +11,10 @@ from modelscope.utils.test_utils import test_level class EfficientDiffusionTuningTest(unittest.TestCase): def setUp(self) -> None: - os.system('pip install ms-swift -U') + # os.system('pip install ms-swift -U') self.task = Tasks.efficient_diffusion_tuning - @unittest.skipUnless(test_level() >= 0, 'skip test in current test level') + @unittest.skip def test_efficient_diffusion_tuning_lora_run_pipeline(self): model_id = 'damo/multi-modal_efficient-diffusion-tuning-lora' model_revision = 'v1.0.2' @@ -24,7 +24,7 @@ class EfficientDiffusionTuningTest(unittest.TestCase): result = edt_pipeline(inputs) print(f'Efficient-diffusion-tuning-lora output: {result}.') - @unittest.skipUnless(test_level() >= 0, 'skip test in current test level') + @unittest.skip def test_efficient_diffusion_tuning_lora_load_model_from_pretrained(self): model_id = 'damo/multi-modal_efficient-diffusion-tuning-lora' model_revision = 'v1.0.2' @@ -32,7 +32,7 @@ class EfficientDiffusionTuningTest(unittest.TestCase): from modelscope.models.multi_modal import EfficientStableDiffusion self.assertTrue(model.__class__ == EfficientStableDiffusion) - @unittest.skipUnless(test_level() >= 0, 'skip test in current test level') + @unittest.skip def test_efficient_diffusion_tuning_control_lora_run_pipeline(self): # TODO: to be fixed in the future model_id = 'damo/multi-modal_efficient-diffusion-tuning-control-lora' @@ -48,7 +48,7 @@ class EfficientDiffusionTuningTest(unittest.TestCase): result = edt_pipeline(inputs) print(f'Efficient-diffusion-tuning-control-lora output: {result}.') - @unittest.skipUnless(test_level() >= 0, 'skip test in current test level') + @unittest.skip def test_efficient_diffusion_tuning_control_lora_load_model_from_pretrained( self): model_id = 'damo/multi-modal_efficient-diffusion-tuning-control-lora'