Spaces:
Sleeping
Sleeping
Update server.py
Browse files
server.py
CHANGED
|
@@ -386,31 +386,14 @@ async def _compose(manifest: ManifestRequest):
|
|
| 386 |
)
|
| 387 |
|
| 388 |
# Filter out numpy warnings from stderr
|
| 389 |
-
|
| 390 |
-
if
|
| 391 |
-
|
| 392 |
-
|
| 393 |
-
|
| 394 |
-
line for line in
|
| 395 |
-
|
| 396 |
-
|
| 397 |
-
"numpy",
|
| 398 |
-
"Numpy",
|
| 399 |
-
"MINGW-W64",
|
| 400 |
-
"CRASHES ARE TO BE EXPECTED",
|
| 401 |
-
"RuntimeWarning",
|
| 402 |
-
"importlib",
|
| 403 |
-
"getlimits",
|
| 404 |
-
"nextafter",
|
| 405 |
-
"ld(",
|
| 406 |
-
"exp2",
|
| 407 |
-
"log10",
|
| 408 |
-
]
|
| 409 |
-
)
|
| 410 |
-
]
|
| 411 |
-
if errors and result.returncode != 0:
|
| 412 |
-
error_summary = "\n".join(errors[-5:]) # Last 5 meaningful lines
|
| 413 |
-
raise Exception(f"Composer failed: {error_summary}")
|
| 414 |
|
| 415 |
# Verify output file exists
|
| 416 |
output_file = RENDERS_DIR / "sunset_reel.mp4"
|
|
|
|
| 386 |
)
|
| 387 |
|
| 388 |
# Filter out numpy warnings from stderr
|
| 389 |
+
# Only treat stderr as error if returncode is non-zero
|
| 390 |
+
if result.returncode != 0:
|
| 391 |
+
error_msg = result.stderr or result.stdout
|
| 392 |
+
if error_msg:
|
| 393 |
+
# Get last few meaningful lines
|
| 394 |
+
lines = [line for line in error_msg.split("\n") if line.strip()]
|
| 395 |
+
error_summary = "\n".join(lines[-3:])
|
| 396 |
+
raise Exception(f"Composer failed with code {result.returncode}: {error_summary}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 397 |
|
| 398 |
# Verify output file exists
|
| 399 |
output_file = RENDERS_DIR / "sunset_reel.mp4"
|