# ๐Ÿš€ Qwen OCR Hugging Face Deployment Package Your Qwen OCR app is ready for deployment to Hugging Face Spaces! ## ๐Ÿ“ Package Contents - **app.py** - Main Gradio application (API-only version, optimized for HF Spaces) - **requirements.txt** - Minimal dependencies for the app - **README.md** - Hugging Face Space card with app description - **deploy.sh** - Automated deployment script (updated with better auth handling) - **auth_check.sh** - Authentication status checker - **deploy_instructions.md** - Detailed deployment instructions - **test_local.py** - Local testing script ## ๐Ÿ”‘ Authentication Required! ### First, check your authentication: ```bash cd /Users/sangmin/Developer/Qwen2.5-VL/huggingface-space ./auth_check.sh ``` ### Get your Hugging Face token: 1. Go to https://huggingface.co/settings/tokens 2. Create a new token with **WRITE** access (not READ!) 3. Copy the token (starts with `hf_...`) ## ๐ŸŽฏ Quick Deploy ### Option 1: Automated Script with Token (Recommended) ```bash cd /Users/sangmin/Developer/Qwen2.5-VL/huggingface-space ./deploy.sh YOUR_HF_USERNAME qwen-ocr-detection YOUR_HF_TOKEN ``` Example: ```bash ./deploy.sh Sangmin qwen-ocr-detection hf_xxxxxxxxxxxxxxxxxxxx ``` ### Option 2: Manual Web Upload 1. Go to https://huggingface.co/new-space 2. Create a new Gradio Space 3. Upload `app.py`, `requirements.txt`, and `README.md` 4. Wait for automatic deployment ### Option 3: Manual Git Commands ```bash cd /Users/sangmin/Developer/Qwen2.5-VL/huggingface-space # First, login with your token huggingface-cli login # Or set token as environment variable export HF_TOKEN=your_token_here # Create Space and push huggingface-cli repo create YOUR_USERNAME/qwen-ocr-detection --type space --space_sdk gradio git init git add . git commit -m "Initial commit" git remote add origin https://huggingface.co/spaces/YOUR_USERNAME/qwen-ocr-detection git push -u origin main ``` ## ๐Ÿงช Test Locally First ```bash cd /Users/sangmin/Developer/Qwen2.5-VL/huggingface-space python test_local.py ``` ## ๐Ÿ”‘ API Key Required Users will need a Dashscope API key from Alibaba Cloud: - Get it here: https://bailian.console.alibabacloud.com/ - The key is entered by users, not stored in the app ## ๐Ÿ“Š Features - โœ… Text detection with bounding boxes - โœ… Support for CJK languages (Chinese, Japanese, Korean) - โœ… JSON output with coordinates - โœ… Multiple model options (2B, 7B, 72B) - โœ… Clean, user-friendly interface ## ๐Ÿ”ง Customization To modify the app: 1. Edit `app.py` with your changes 2. Test locally with `python test_local.py` 3. Push updates: ```bash git add . git commit -m "Update: your changes" git push ``` ## ๐Ÿ“ Notes - The app uses Alibaba Cloud's API (no local model loading) - Perfect for Hugging Face's free tier - Auto-builds on push - Public or private Space options available ## ๐ŸŒ After Deployment Your Space URL will be: ``` https://huggingface.co/spaces/YOUR_USERNAME/qwen-ocr-detection ``` Share this URL with others to use your OCR app! --- **Ready to deploy!** Choose your preferred method above and your OCR app will be live on Hugging Face Spaces in minutes. ๐ŸŽ‰