Spaces:
Runtime error
Runtime error
A newer version of the Gradio SDK is available: 6.13.0
β οΈ Local Testing Issue - NumPy Compatibility
Problem
Your system has Python 3.13.5, which only supports NumPy 2.x. However, the eDOCr2 library and its dependencies (especially imgaug) require NumPy 1.x.
Error encountered:
AttributeError: `np.sctypes` was removed in the NumPy 2.0 release
Solutions
β Option 1: Deploy Directly to Hugging Face (RECOMMENDED)
Hugging Face Spaces uses Python 3.10 which supports NumPy 1.26.4. Your app will work perfectly there!
Steps:
- Download model files (see HUGGINGFACE_CHECKLIST.md)
- Create Hugging Face Space
- Upload all files
- It will work automatically!
Advantages:
- β No local setup needed
- β Correct Python/NumPy versions
- β Free hosting
- β Share with anyone
βοΈ Option 2: Install Python 3.10 or 3.11 Locally
If you want to test locally, install an older Python version:
Windows:
- Download Python 3.10.11 from python.org
- Install (check "Add to PATH")
- Create virtual environment:
py -3.10 -m venv venv venv\Scripts\activate pip install -r requirements.txt python app.py
Advantages:
- β Can test locally before deploying
- β Full compatibility
Disadvantages:
- β Need to install another Python version
- β More setup time
π§ Option 3: Use Docker (Advanced)
Create a Docker container with Python 3.10:
FROM python:3.10-slim
WORKDIR /app
COPY . .
RUN apt-get update && apt-get install -y tesseract-ocr poppler-utils
RUN pip install -r requirements.txt
CMD ["python", "app.py"]
Current Status
β Files Created:
- app.py (Gradio interface)
- requirements.txt (dependencies)
- packages.txt (system deps)
- README.md (Hugging Face description)
- .gitattributes (Git LFS config)
- DEPLOYMENT.md (deployment guide)
- HUGGINGFACE_CHECKLIST.md (quick reference)
β Model Files:
- All 4 model files are present in
edocr2/models/
β Ready for Deployment:
- Everything is configured for Hugging Face Spaces
- Just need to upload to Hugging Face
Recommendation
Skip local testing and deploy directly to Hugging Face!
Reasons:
- Hugging Face handles the environment automatically
- No Python version conflicts
- Free hosting
- Can test there just as easily
- Share with others immediately
Next Steps
- Create Hugging Face Account (if you don't have one)
- Create New Space (SDK: Gradio)
- Upload Files (see DEPLOYMENT.md for detailed steps)
- Wait for Build (5-10 minutes)
- Test Your App online!
Need help with deployment? Check DEPLOYMENT.md for step-by-step instructions!