#!/bin/bash # Deploy script for Hugging Face Spaces # This script helps deploy the ALPR OCR system to Hugging Face set -e echo "🚀 Starting deployment to Hugging Face Spaces..." # Check if git is initialized if [ ! -d ".git" ]; then echo "📁 Initializing git repository..." git init git remote add origin https://huggingface.co/spaces/Japhari/alpr-ocr fi # Check if git-lfs is installed if ! command -v git-lfs &> /dev/null; then echo "⚠️ git-lfs is not installed. Please install it first:" echo " macOS: brew install git-lfs" echo " Ubuntu: sudo apt-get install git-lfs" echo " Windows: https://git-lfs.github.com/" exit 1 fi # Setup git-lfs echo "🔧 Setting up git-lfs..." git lfs install git lfs track "*.py" git lfs track "*.md" git lfs track "*.txt" git lfs track "*.toml" git lfs track "*.yml" git lfs track "*.yaml" git lfs track "*.sh" # Add all files echo "📝 Adding files to git..." git add . # Commit changes echo "💾 Committing changes..." git commit -m "Update ALPR OCR system - $(date)" # Push to Hugging Face echo "🚀 Pushing to Hugging Face Spaces..." git push origin main echo "✅ Deployment completed successfully!" echo "🌐 Your Space is available at: https://huggingface.co/spaces/Japhari/alpr-ocr" echo "⏳ It may take a few minutes for the changes to appear."