Spaces:
Running
on
Zero
Running
on
Zero
Update app_lora1.py
Browse files- app_lora1.py +29 -0
app_lora1.py
CHANGED
|
@@ -138,6 +138,35 @@ def register_scripts(selected_scripts):
|
|
| 138 |
# =========================================================
|
| 139 |
def extract_pipe_lines(script_code: str):
|
| 140 |
lines = script_code.splitlines()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 141 |
print(lines)
|
| 142 |
pipe_lines = []
|
| 143 |
found = False
|
|
|
|
| 138 |
# =========================================================
|
| 139 |
def extract_pipe_lines(script_code: str):
|
| 140 |
lines = script_code.splitlines()
|
| 141 |
+
|
| 142 |
+
# Log full .py file
|
| 143 |
+
log("=== SCRIPT CONTENT START ===")
|
| 144 |
+
for l in lines:
|
| 145 |
+
log(l)
|
| 146 |
+
log("=== SCRIPT CONTENT END ===")
|
| 147 |
+
|
| 148 |
+
pipe_lines = []
|
| 149 |
+
found = False
|
| 150 |
+
|
| 151 |
+
for line in lines:
|
| 152 |
+
stripped = line.strip()
|
| 153 |
+
if not found and stripped.startswith("pipe = ZImagePipeline.from_pretrained"):
|
| 154 |
+
found = True
|
| 155 |
+
pipe_lines.append(line)
|
| 156 |
+
elif found:
|
| 157 |
+
# Include all subsequent lines that reference 'pipe'
|
| 158 |
+
if "pipe" in stripped:
|
| 159 |
+
pipe_lines.append(line)
|
| 160 |
+
|
| 161 |
+
# Log the extracted lines after from_pretrained
|
| 162 |
+
log("🔧 Extracted pipe-related lines:")
|
| 163 |
+
for l in pipe_lines:
|
| 164 |
+
log(f"• {l.strip()}")
|
| 165 |
+
|
| 166 |
+
return pipe_lines
|
| 167 |
+
|
| 168 |
+
def extract_pipe_lines0(script_code: str):
|
| 169 |
+
lines = script_code.splitlines()
|
| 170 |
print(lines)
|
| 171 |
pipe_lines = []
|
| 172 |
found = False
|