#!/bin/bash # Script to set up the HF Spaces environment set -e echo "Setting up Universal Translator API on Hugging Face Spaces..." # Create directories mkdir -p app/models mkdir -p app/utils mkdir -p config # Move Python files to their correct locations mv api_server.py ./ mv app/models/translation_model.py app/models/ mv app/models/document_processor.py app/models/ mv app/models/html_processor.py app/models/ mv app/models/text_chunker.py app/models/ # Initialize __init__.py files touch app/__init__.py touch app/models/__init__.py touch app/utils/__init__.py # Download NLTK data python -c "import nltk; nltk.download('punkt')" echo "Setup complete!"