nur-brain / app /entrypoint.sh
isam0's picture
Update app/entrypoint.sh
78c0ed2 verified
#!/bin/bash
# 1. Path where the app looks for the model
MODEL_PATH="/app/models/nur.gguf"
# Check if model exists
if [ -f "$MODEL_PATH" ]; then
echo "βœ… Nur Brain is already in storage."
else
echo "⏳ Brain missing. Downloading Qwen2.5-1.5B-Instruct..."
mkdir -p /app/models
# ⬇️ VERIFIED DOWNLOAD SECTION ⬇️
python3 -c "
from huggingface_hub import hf_hub_download
import os
try:
# This is the official and stable repository for Qwen2.5 GGUF
path = hf_hub_download(
repo_id='Qwen/Qwen2.5-1.5B-Instruct-GGUF',
filename='qwen2.5-1.5b-instruct-q4_k_m.gguf',
local_dir='/app/models',
local_dir_use_symlinks=False
)
# Rename to your custom filename
os.rename(path, '/app/models/nur.gguf')
print('βœ… Qwen Download complete!')
except Exception as e:
print(f'❌ Download failed: {e}')
exit(1)
"
fi
# Double check
if [ ! -f "$MODEL_PATH" ]; then
echo "❌ CRITICAL: Model file still missing."
exit 1
fi
echo "πŸš€ Starting Isam's Nur Brain on Port 7860..."
# Start the API
exec uvicorn app.main:app --host 0.0.0.0 --port 7860