Correct check of model_index.json file
Browse files- pipeline_loader.py +4 -3
pipeline_loader.py
CHANGED
|
@@ -20,10 +20,11 @@ def get_pipeline(model_path):
|
|
| 20 |
# Try to load config to determine if it's text-conditional
|
| 21 |
try:
|
| 22 |
config, _ = DiffusionPipeline.load_config(model_path)
|
| 23 |
-
|
| 24 |
except Exception:
|
| 25 |
-
|
| 26 |
-
|
|
|
|
| 27 |
# Use the local pipeline file for custom_pipeline
|
| 28 |
pipe = DiffusionPipeline.from_pretrained(
|
| 29 |
model_path,
|
|
|
|
| 20 |
# Try to load config to determine if it's text-conditional
|
| 21 |
try:
|
| 22 |
config, _ = DiffusionPipeline.load_config(model_path)
|
| 23 |
+
has_text_encoder = "text_encoder" in config
|
| 24 |
except Exception:
|
| 25 |
+
print(f"Warning: Could not load config: {e}")
|
| 26 |
+
has_text_encoder = False
|
| 27 |
+
if has_text_encoder:
|
| 28 |
# Use the local pipeline file for custom_pipeline
|
| 29 |
pipe = DiffusionPipeline.from_pretrained(
|
| 30 |
model_path,
|