Download api/start.sh from Text-to-Document-Generation/Docgenie-API: direct link, hf CLI and curl.
- Browser
- Download file 1.01 kB
-
https://huggingface.co/spaces/Text-to-Document-Generation/Docgenie-API/resolve/main/api/start.sh
- Command line
-
hf download hf://spaces/Text-to-Document-Generation/Docgenie-API/api/start.sh
-
curl -L -o start.sh https://huggingface.co/spaces/Text-to-Document-Generation/Docgenie-API/resolve/main/api/start.sh
1.01 kB
| # Start the DocGenie API server | |
| # Note: All dependencies should be installed via 'uv sync' or 'pip install -e .' | |
| echo "Starting DocGenie API..." | |
| # Check if .env file exists | |
| if [ ! -f .env ]; then | |
| echo "Warning: .env file not found. Using .env.example as template." | |
| echo "Please copy .env.example to .env and set your ANTHROPIC_API_KEY" | |
| if [ -f .env.example ]; then | |
| cp .env.example .env | |
| echo "Created .env file from .env.example" | |
| fi | |
| fi | |
| # Load environment variables | |
| if [ -f .env ]; then | |
| export $(cat .env | grep -v '^#' | xargs) | |
| fi | |
| # Check if ANTHROPIC_API_KEY is set | |
| if [ -z "$ANTHROPIC_API_KEY" ]; then | |
| echo "Error: ANTHROPIC_API_KEY not set in .env file" | |
| exit 1 | |
| fi | |
| # Default values | |
| HOST=${API_HOST:-0.0.0.0} | |
| PORT=${API_PORT:-8000} | |
| WORKERS=${API_WORKERS:-4} | |
| echo "Configuration:" | |
| echo " Host: $HOST" | |
| echo " Port: $PORT" | |
| echo " Workers: $WORKERS" | |
| echo "" | |
| # Start the API | |
| uvicorn main:app --host $HOST --port $PORT --workers $WORKERS --reload | |