Spaces:
Running
on
Zero
Running
on
Zero
- Dockerfile +27 -10
Dockerfile
CHANGED
@@ -1,29 +1,46 @@
|
|
1 |
-
# ZeroGPU Dockerfile for HF Spaces Pro
|
2 |
-
|
3 |
-
FROM python:3.9
|
4 |
|
5 |
# Set environment variables
|
6 |
ENV PYTHONUNBUFFERED=1
|
|
|
7 |
|
8 |
# Install system dependencies
|
9 |
RUN apt-get update && apt-get install -y \
|
10 |
git \
|
11 |
wget \
|
|
|
|
|
12 |
&& rm -rf /var/lib/apt/lists/*
|
13 |
|
14 |
# Create user (required for HF Spaces)
|
15 |
RUN useradd -m -u 1000 user
|
16 |
WORKDIR /app
|
17 |
|
18 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
COPY --chown=user requirements.txt .
|
20 |
|
21 |
-
# Install Python dependencies
|
22 |
-
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
23 |
-
|
24 |
-
# Install PyTorch with CUDA support for H200
|
25 |
-
RUN pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
|
26 |
-
|
27 |
# Copy application code
|
28 |
COPY --chown=user . .
|
29 |
|
|
|
1 |
+
# ZeroGPU Dockerfile for HF Spaces Pro - FIXED VERSION
|
2 |
+
FROM python:3.9-slim
|
|
|
3 |
|
4 |
# Set environment variables
|
5 |
ENV PYTHONUNBUFFERED=1
|
6 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
7 |
|
8 |
# Install system dependencies
|
9 |
RUN apt-get update && apt-get install -y \
|
10 |
git \
|
11 |
wget \
|
12 |
+
curl \
|
13 |
+
build-essential \
|
14 |
&& rm -rf /var/lib/apt/lists/*
|
15 |
|
16 |
# Create user (required for HF Spaces)
|
17 |
RUN useradd -m -u 1000 user
|
18 |
WORKDIR /app
|
19 |
|
20 |
+
# Upgrade pip first
|
21 |
+
RUN pip install --upgrade pip
|
22 |
+
|
23 |
+
# Install packages INDIVIDUALLY to catch errors
|
24 |
+
RUN pip install --no-cache-dir gradio==4.44.0
|
25 |
+
RUN pip install --no-cache-dir spaces
|
26 |
+
RUN pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
|
27 |
+
RUN pip install --no-cache-dir transformers==4.48.2
|
28 |
+
RUN pip install --no-cache-dir sentence-transformers
|
29 |
+
RUN pip install --no-cache-dir python-docx
|
30 |
+
RUN pip install --no-cache-dir pymupdf
|
31 |
+
RUN pip install --no-cache-dir unstructured
|
32 |
+
RUN pip install --no-cache-dir sqlite-utils
|
33 |
+
RUN pip install --no-cache-dir pandas
|
34 |
+
RUN pip install --no-cache-dir numpy
|
35 |
+
RUN pip install --no-cache-dir huggingface_hub
|
36 |
+
RUN pip install --no-cache-dir accelerate
|
37 |
+
|
38 |
+
# Install PyLate LAST (it's finicky)
|
39 |
+
RUN pip install --no-cache-dir pylate==1.2.0
|
40 |
+
|
41 |
+
# Copy requirements file (as backup)
|
42 |
COPY --chown=user requirements.txt .
|
43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
# Copy application code
|
45 |
COPY --chown=user . .
|
46 |
|