Spaces:
Paused
Paused
Update app_lora1.py
Browse files- app_lora1.py +5 -22
app_lora1.py
CHANGED
|
@@ -103,28 +103,8 @@ def get_pipeline(script_name):
|
|
| 103 |
"__file__": script_name,
|
| 104 |
"__name__": "__main__",
|
| 105 |
|
| 106 |
-
#
|
| 107 |
"torch": torch,
|
| 108 |
-
|
| 109 |
-
# Diffusers
|
| 110 |
-
"DiffusionPipeline": DiffusionPipeline,
|
| 111 |
-
|
| 112 |
-
# Z-Image specific (imported lazily)
|
| 113 |
-
"ZImagePipeline": __import__(
|
| 114 |
-
"diffusers.pipelines.z_image.pipeline_z_image",
|
| 115 |
-
fromlist=["ZImagePipeline"],
|
| 116 |
-
).ZImagePipeline,
|
| 117 |
-
|
| 118 |
-
"ZImageTransformer2DModel": __import__(
|
| 119 |
-
"diffusers.models.transformers.z_image_transformer_2d",
|
| 120 |
-
fromlist=["ZImageTransformer2DModel"],
|
| 121 |
-
).ZImageTransformer2DModel,
|
| 122 |
-
|
| 123 |
-
# Quantization helpers
|
| 124 |
-
"GGUFQuantizationConfig": __import__(
|
| 125 |
-
"diffusers.quantizers.gguf",
|
| 126 |
-
fromlist=["GGUFQuantizationConfig"],
|
| 127 |
-
).GGUFQuantizationConfig,
|
| 128 |
}
|
| 129 |
|
| 130 |
try:
|
|
@@ -134,7 +114,10 @@ def get_pipeline(script_name):
|
|
| 134 |
raise RuntimeError(f"Pipeline build failed for {script_name}") from e
|
| 135 |
|
| 136 |
if "pipe" not in namespace:
|
| 137 |
-
raise RuntimeError(
|
|
|
|
|
|
|
|
|
|
| 138 |
|
| 139 |
PIPELINES[script_name] = namespace["pipe"]
|
| 140 |
log(f"✅ Pipeline ready: {script_name}")
|
|
|
|
| 103 |
"__file__": script_name,
|
| 104 |
"__name__": "__main__",
|
| 105 |
|
| 106 |
+
# Minimal required globals
|
| 107 |
"torch": torch,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 108 |
}
|
| 109 |
|
| 110 |
try:
|
|
|
|
| 114 |
raise RuntimeError(f"Pipeline build failed for {script_name}") from e
|
| 115 |
|
| 116 |
if "pipe" not in namespace:
|
| 117 |
+
raise RuntimeError(
|
| 118 |
+
f"{script_name} did not define `pipe`.\n"
|
| 119 |
+
f"Each script MUST assign a variable named `pipe`."
|
| 120 |
+
)
|
| 121 |
|
| 122 |
PIPELINES[script_name] = namespace["pipe"]
|
| 123 |
log(f"✅ Pipeline ready: {script_name}")
|