Spaces:
Runtime error
Runtime error
Fix: Add explicit stdout output for Spaces demo detection
Browse files
app.py
CHANGED
|
@@ -1091,6 +1091,15 @@ if IS_SPACES:
|
|
| 1091 |
# Make sure demo is accessible
|
| 1092 |
__all__ = ['demo'] # Explicitly export demo
|
| 1093 |
logger.info("Demo is ready for Spaces")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1094 |
else:
|
| 1095 |
logger.error("CRITICAL: Demo is not valid even after all checks!")
|
| 1096 |
|
|
|
|
| 1091 |
# Make sure demo is accessible
|
| 1092 |
__all__ = ['demo'] # Explicitly export demo
|
| 1093 |
logger.info("Demo is ready for Spaces")
|
| 1094 |
+
|
| 1095 |
+
# CRITICAL: For Spaces, we must ensure the demo is definitely accessible
|
| 1096 |
+
# Sometimes Spaces has issues if the demo isn't immediately available
|
| 1097 |
+
# Let's also print it to stdout so Spaces can definitely see it
|
| 1098 |
+
import sys
|
| 1099 |
+
print("=" * 80, file=sys.stdout)
|
| 1100 |
+
print(f"DEMO_READY: {type(demo)}", file=sys.stdout)
|
| 1101 |
+
print(f"DEMO_VALID: {isinstance(demo, (gr.Blocks, gr.Interface))}", file=sys.stdout)
|
| 1102 |
+
print("=" * 80, file=sys.stdout)
|
| 1103 |
else:
|
| 1104 |
logger.error("CRITICAL: Demo is not valid even after all checks!")
|
| 1105 |
|