Spaces:
Build error
Build error
| # Update Textilindo AI Assistant on Hugging Face Spaces | |
| # This script will update your existing HF Space with the Docker fixes | |
| set -e | |
| SPACE_DIR="Textilindo" | |
| REPO_URL="https://huggingface.co/spaces/harismlnaslm/Textilindo" | |
| echo "π Updating Textilindo AI Assistant on Hugging Face Spaces" | |
| echo "Repository: $REPO_URL" | |
| echo "" | |
| # Check if the space directory already exists | |
| if [ -d "$SPACE_DIR" ]; then | |
| echo "π Using existing repository: $SPACE_DIR" | |
| cd "$SPACE_DIR" | |
| # Pull latest changes | |
| echo "π₯ Pulling latest changes..." | |
| git pull origin main | |
| else | |
| echo "π₯ Cloning space repository..." | |
| echo "β οΈ You'll need to use your Hugging Face access token as password" | |
| echo " Get your token from: https://huggingface.co/settings/tokens" | |
| echo "" | |
| git clone "$REPO_URL" | |
| cd "$SPACE_DIR" | |
| fi | |
| echo "π Copying updated files to space repository..." | |
| # Copy the fixed files | |
| echo "β Copying app_gradio.py (with Docker fixes)..." | |
| cp ../app_gradio.py . | |
| echo "β Copying updated Dockerfile (points to app_gradio.py)..." | |
| cp ../Dockerfile . | |
| echo "β Copying requirements.txt..." | |
| cp ../requirements.txt . | |
| echo "β Copying README.md..." | |
| cp ../README.md . | |
| # Copy templates directory | |
| if [ -d "../templates" ]; then | |
| cp -r ../templates . | |
| echo "β Templates copied" | |
| fi | |
| # Copy configs directory | |
| if [ -d "../configs" ]; then | |
| cp -r ../configs . | |
| echo "β Configs copied" | |
| fi | |
| # Copy data directory (if exists) | |
| if [ -d "../data" ]; then | |
| cp -r ../data . | |
| echo "β Data copied" | |
| fi | |
| # Copy the deployment guide | |
| if [ -f "../HF_SPACES_DEPLOYMENT.md" ]; then | |
| cp ../HF_SPACES_DEPLOYMENT.md . | |
| echo "β Deployment guide copied" | |
| fi | |
| echo "" | |
| echo "π Files ready for deployment:" | |
| ls -la | |
| echo "" | |
| echo "π§ Key fixes included:" | |
| echo "β Dockerfile now points to app_gradio.py" | |
| echo "β app_gradio.py has enhanced error handling" | |
| echo "β Process keep-alive mechanism added" | |
| echo "β Fallback interface for error recovery" | |
| echo "" | |
| echo "π Ready to deploy! Run these commands:" | |
| echo "" | |
| echo "git add ." | |
| echo "git commit -m 'Fix: Docker container stopping issue - Enhanced Gradio interface'" | |
| echo "git push" | |
| echo "" | |
| echo "π Your updated app will be available at: $REPO_URL" | |
| echo "" | |
| echo "π Monitor the deployment:" | |
| echo "1. Go to: https://huggingface.co/spaces/harismlnaslm/Textilindo" | |
| echo "2. Check the 'Logs' tab to see the build progress" | |
| echo "3. Wait for the build to complete (usually 2-5 minutes)" | |
| echo "" | |
| echo "β The container should now stay alive and serve your app properly!" | |