Spaces:
Paused
Paused
| set -euo pipefail | |
| APP_DIR="/home/user/app" | |
| LLAMA_DIR="${APP_DIR}/llama.cpp" | |
| echo "Starting gguf-my-repo Space startup script..." | |
| cd "${APP_DIR}" | |
| echo "Preparing persistent storage..." | |
| mkdir -p /data/.huggingface/hub | |
| mkdir -p /data/.huggingface/transformers | |
| mkdir -p /data/gguf-downloads | |
| mkdir -p /data/gguf-outputs | |
| export HF_HOME=/data/.huggingface | |
| export HF_HUB_CACHE=/data/.huggingface/hub | |
| export TRANSFORMERS_CACHE=/data/.huggingface/transformers | |
| export TMPDIR=/tmp | |
| echo "Linking app working directories to persistent storage..." | |
| rm -rf "${APP_DIR}/downloads" | |
| rm -rf "${APP_DIR}/outputs" | |
| ln -s /data/gguf-downloads "${APP_DIR}/downloads" | |
| ln -s /data/gguf-outputs "${APP_DIR}/outputs" | |
| echo "Checking llama.cpp binaries (pre-built in Docker image)..." | |
| test -x "${LLAMA_DIR}/llama-quantize" | |
| test -x "${LLAMA_DIR}/llama-gguf-split" | |
| test -x "${LLAMA_DIR}/llama-imatrix" | |
| ls -lah "${LLAMA_DIR}/llama-quantize" "${LLAMA_DIR}/llama-gguf-split" "${LLAMA_DIR}/llama-imatrix" | |
| echo "Starting Gradio app..." | |
| exec python app.py | |