28
28
29
29
import numpy as np
30
30
import PIL .Image
31
+ import pytest
31
32
import requests_mock
32
33
import safetensors .torch
33
34
import torch
62
63
)
63
64
from diffusers .pipelines .pipeline_utils import _get_pipeline_class
64
65
from diffusers .schedulers .scheduling_utils import SCHEDULER_CONFIG_NAME
65
- from diffusers .utils import (
66
- CONFIG_NAME ,
67
- WEIGHTS_NAME ,
68
- )
66
+ from diffusers .utils import CONFIG_NAME , WEIGHTS_NAME , is_transformers_version
69
67
from diffusers .utils .torch_utils import is_compiled_module
70
68
71
69
from ..testing_utils import (
@@ -584,6 +582,7 @@ def test_download_variants_with_sharded_checkpoints(self):
584
582
assert not any (f .endswith (unexpected_ext ) for f in files )
585
583
assert all (variant in f for f in model_files if f .endswith (model_ext ) and variant is not None )
586
584
585
+ @pytest .mark .xfail (condition = is_transformers_version (">" , "4.56.2" ), reason = "Some import error" , strict = True )
587
586
def test_download_legacy_variants_with_sharded_ckpts_raises_warning (self ):
588
587
repo_id = "hf-internal-testing/tiny-stable-diffusion-pipe-variants-all-kinds"
589
588
logger = logging .get_logger ("diffusers.pipelines.pipeline_utils" )
@@ -690,6 +689,7 @@ def test_download_bin_variant_does_not_exist_for_model(self):
690
689
)
691
690
assert "Error no file name" in str (error_context .exception )
692
691
692
+ @pytest .mark .xfail (condition = is_transformers_version (">" , "4.56.2" ), reason = "Some import error" , strict = True )
693
693
def test_local_save_load_index (self ):
694
694
prompt = "hello"
695
695
for variant in [None , "fp16" ]:
@@ -1584,6 +1584,7 @@ def test_save_safe_serialization(self):
1584
1584
assert pipeline .scheduler is not None
1585
1585
assert pipeline .feature_extractor is not None
1586
1586
1587
+ @pytest .mark .xfail (condition = is_transformers_version (">" , "4.56.2" ), reason = "Some import error" , strict = True )
1587
1588
def test_no_pytorch_download_when_doing_safetensors (self ):
1588
1589
# by default we don't download
1589
1590
with tempfile .TemporaryDirectory () as tmpdirname :
@@ -1603,6 +1604,7 @@ def test_no_pytorch_download_when_doing_safetensors(self):
1603
1604
# pytorch does not
1604
1605
assert not os .path .exists (os .path .join (path , "diffusion_pytorch_model.bin" ))
1605
1606
1607
+ @pytest .mark .xfail (condition = is_transformers_version (">" , "4.56.2" ), reason = "Some import error" , strict = True )
1606
1608
def test_no_safetensors_download_when_doing_pytorch (self ):
1607
1609
use_safetensors = False
1608
1610
0 commit comments