UI-VieNeu / start.sh
HuuDatLego's picture
Upload folder using huggingface_hub
911c66e verified
#!/bin/bash
# 1. Khởi động Redis dưới background
echo "Starting Redis server..."
redis-server --daemonize yes
# Đợi Redis sẵn sàng
sleep 3
# 2. Khởi động Celery Worker dưới background
echo "Starting Celery worker..."
# Lưu ý: Trên Linux chúng ta không dùng -P solo để tận dụng đa nhân
celery -A worker:celery_app worker --loglevel=info &
# 3. Khởi động FastAPI (Uvicorn) chạy chính
echo "Starting FastAPI server on port 7860..."
# Hugging Face yêu cầu chạy trên host 0.0.0.0 và port 7860
uvicorn main:app --host 0.0.0.0 --port 7860