Spaces:
Sleeping
Sleeping
Upload scripts/entrypoint.sh with huggingface_hub
Browse files- scripts/entrypoint.sh +10 -8
scripts/entrypoint.sh
CHANGED
|
@@ -1,11 +1,13 @@
|
|
| 1 |
#!/bin/bash
|
| 2 |
-
set -e
|
| 3 |
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
mkdir -p /data/workspace
|
| 8 |
-
echo "[PARENT] ✅ Directory structure created."
|
| 9 |
|
| 10 |
-
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
#!/bin/bash
|
|
|
|
| 2 |
|
| 3 |
+
# SURVIVAL FIX: Ensure Python environment is clean and paths are set
|
| 4 |
+
export PYTHONPATH="${PYTHONPATH}:/home/user/app"
|
| 5 |
+
export GRADIO_SERVER_NAME="0.0.0.0"
|
|
|
|
|
|
|
| 6 |
|
| 7 |
+
# Fail-safe: Create a dummy .env if it doesn't exist to prevent load errors
|
| 8 |
+
if [ ! -f /home/user/app/.env ]; then
|
| 9 |
+
echo "HF_TOKEN=\n" > /home/user/app/.env
|
| 10 |
+
fi
|
| 11 |
+
|
| 12 |
+
# Execute the passed command (usually "python app.py" or "python launcher.py")
|
| 13 |
+
exec "$@"
|