#!/bin/bash # Script to update the Hugging Face Space with fixes echo "🔧 Updating Hugging Face Space with fixes..." echo "" # Check if git is initialized if [ ! -d .git ]; then echo "❌ Not in a git repository. Please run deploy.sh first." exit 1 fi # Add and commit changes echo "📦 Committing fixes..." git add app.py requirements.txt app_simple.py packages.txt git commit -m "Fix: Gradio compatibility and CJK font support - Updated Gradio to stable version 4.19.2 - Fixed launch configuration for HF Spaces - Added packages.txt to install CJK fonts - Updated font paths for Linux/HF Spaces - Added simplified fallback version (app_simple.py) - Relaxed dependency versions for better compatibility" # Push to Hugging Face echo "📤 Pushing updates..." if git push origin main; then echo "✅ Updates pushed successfully!" echo "" echo "The Space should rebuild automatically. Check the logs on Hugging Face." echo "" echo "If the main app still has issues, you can switch to app_simple.py:" echo "1. Go to your Space settings" echo "2. Change 'app_file' from 'app.py' to 'app_simple.py'" else echo "❌ Push failed. Please check your authentication and try again." exit 1 fi