Spaces:
Runtime error
Runtime error
| set -e | |
| APP_DIR="$(cd "$(dirname "$0")" && pwd)" | |
| cd "$APP_DIR" | |
| sudo apt update -y | |
| sudo apt install -y curl python3 python3-venv python3-pip tesseract-ocr tesseract-ocr-spa | |
| if ! command -v ollama >/dev/null 2>&1; then | |
| curl -fsSL https://ollama.com/install.sh | sh | |
| fi | |
| if sudo systemctl enable --now ollama 2>/dev/null; then | |
| echo "Ollama iniciado" | |
| else | |
| nohup ollama serve >/tmp/ollama_serve.log 2>&1 & | |
| sleep 3 | |
| fi | |
| python3 -m venv .venv | |
| source .venv/bin/activate | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| mkdir -p saved_chats | |
| python app.py | |