aladhefafalquran commited on
Commit
df78b63
·
1 Parent(s): b026de9

Convert to Docker SDK for HF Spaces

Browse files

BREAKING: Complete migration from Gradio SDK to Docker SDK

This resolves all Gradio version compatibility issues by using Docker
to control the entire environment.

Changes:
- Created Dockerfile with Python 3.10 base image
- Pinned stable package versions (Gradio 3.50.2, Transformers 4.35.0)
- Updated README.md: sdk: docker, app_port: 7860
- Docker gives us full control over dependencies and environment

The app will now run in an isolated Docker container with guaranteed
compatible versions of all packages.

Files changed (3) hide show
  1. Dockerfile +26 -0
  2. README.md +2 -3
  3. requirements.txt +5 -5
Dockerfile ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # Install system dependencies
6
+ RUN apt-get update && apt-get install -y \
7
+ build-essential \
8
+ && rm -rf /var/lib/apt/lists/*
9
+
10
+ # Copy requirements first for better caching
11
+ COPY requirements.txt .
12
+
13
+ # Install Python dependencies
14
+ RUN pip install --no-cache-dir -r requirements.txt
15
+
16
+ # Copy application files
17
+ COPY app.py .
18
+
19
+ # Expose Gradio default port
20
+ EXPOSE 7860
21
+
22
+ # Set environment variables
23
+ ENV GRADIO_SERVER_NAME="0.0.0.0"
24
+
25
+ # Run the application
26
+ CMD ["python", "app.py"]
README.md CHANGED
@@ -3,9 +3,8 @@ title: AI-Powered PDF Summarizer
3
  emoji: 📚
4
  colorFrom: blue
5
  colorTo: purple
6
- sdk: gradio
7
- sdk_version: 4.44.0
8
- app_file: app.py
9
  pinned: false
10
  ---
11
 
 
3
  emoji: 📚
4
  colorFrom: blue
5
  colorTo: purple
6
+ sdk: docker
7
+ app_port: 7860
 
8
  pinned: false
9
  ---
10
 
requirements.txt CHANGED
@@ -1,5 +1,5 @@
1
- gradio
2
- transformers
3
- torch
4
- PyMuPDF
5
- numpy<2
 
1
+ gradio==3.50.2
2
+ transformers==4.35.0
3
+ torch==2.1.0
4
+ PyMuPDF==1.23.8
5
+ numpy==1.24.3