better error message
Browse files
models/pipeline_loader.py
CHANGED
|
@@ -18,12 +18,10 @@ def get_pipeline(model_path):
|
|
| 18 |
else:
|
| 19 |
# Assume it's a Hugging Face Hub model ID
|
| 20 |
# Try to load config to determine if it's text-conditional
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 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(
|
|
|
|
| 18 |
else:
|
| 19 |
# Assume it's a Hugging Face Hub model ID
|
| 20 |
# Try to load config to determine if it's text-conditional
|
| 21 |
+
print(model_path)
|
| 22 |
+
config, _ = DiffusionPipeline.load_config(model_path)
|
| 23 |
+
has_text_encoder = "text_encoder" in config
|
| 24 |
+
|
|
|
|
|
|
|
| 25 |
if has_text_encoder:
|
| 26 |
# Use the local pipeline file for custom_pipeline
|
| 27 |
pipe = DiffusionPipeline.from_pretrained(
|