Skip to content

Commit de58781

Browse files
committed
remove unneeded test.
1 parent dc91905 commit de58781

File tree

1 file changed

+0
-28
lines changed

1 file changed

+0
-28
lines changed

tests/modular_pipelines/test_modular_pipelines_common.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
import gc
2-
import json
3-
import os
42
from typing import Callable
53

64
import pytest
@@ -349,32 +347,6 @@ def test_save_from_pretrained(self, tmp_path):
349347

350348
assert torch.abs(image_slices[0] - image_slices[1]).max() < 1e-3
351349

352-
def test_modular_index_consistency(self, tmp_path):
353-
pipe = self.get_pipeline()
354-
components_spec = pipe._component_specs
355-
components = sorted(components_spec.keys())
356-
357-
pipe.save_pretrained(tmp_path)
358-
index_file = os.path.join(tmp_path, "modular_model_index.json")
359-
assert os.path.exists(index_file)
360-
361-
with open(index_file) as f:
362-
index_contents = json.load(f)
363-
364-
compulsory_keys = {"_blocks_class_name", "_class_name", "_diffusers_version"}
365-
for k in compulsory_keys:
366-
assert k in index_contents
367-
368-
to_check_attrs = {"pretrained_model_name_or_path", "revision", "subfolder"}
369-
for component in components:
370-
spec = components_spec[component]
371-
for attr in to_check_attrs:
372-
if getattr(spec, "pretrained_model_name_or_path", None) is not None:
373-
for attr in to_check_attrs:
374-
assert component in index_contents, f"{component} should be present in index but isn't."
375-
attr_value_from_index = index_contents[component][2][attr]
376-
assert getattr(spec, attr) == attr_value_from_index
377-
378350
def test_workflow_map(self):
379351
blocks = self.pipeline_blocks_class()
380352
if blocks._workflow_map is None:

0 commit comments

Comments
 (0)