Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +12 -10
Dockerfile
CHANGED
@@ -15,28 +15,29 @@ WORKDIR /app
|
|
15 |
|
16 |
# Install Python dependencies in correct order
|
17 |
RUN pip install --no-cache-dir --upgrade pip && \
|
18 |
-
# Install
|
|
|
|
|
19 |
pip install --no-cache-dir \
|
20 |
torch==2.1.0 \
|
21 |
torchvision==0.16.0 \
|
22 |
-
ninja
|
23 |
-
|
24 |
-
pip install --no-cache-dir autoawq && \
|
25 |
-
# Install other dependencies
|
26 |
-
pip install --no-cache-dir \
|
27 |
-
git+https://github.com/huggingface/transformers \
|
28 |
accelerate \
|
29 |
qwen-vl-utils[decord]==0.0.8 \
|
30 |
fastapi \
|
31 |
uvicorn[standard] \
|
32 |
python-multipart \
|
33 |
pillow \
|
34 |
-
pydantic
|
|
|
|
|
|
|
35 |
|
36 |
# Copy application files
|
37 |
COPY --chown=user:user . /app
|
38 |
|
39 |
-
# Create
|
40 |
RUN mkdir -p /home/user/.cache/huggingface && \
|
41 |
mkdir -p /temp && \
|
42 |
chown -R user:user /home/user/.cache && \
|
@@ -49,7 +50,8 @@ USER user
|
|
49 |
ENV HOME=/home/user \
|
50 |
PATH=/home/user/.local/bin:$PATH \
|
51 |
TRANSFORMERS_CACHE=/home/user/.cache/huggingface \
|
52 |
-
TORCH_HOME=/home/user/.cache/torch
|
|
|
53 |
|
54 |
# Expose the port
|
55 |
EXPOSE 7860
|
|
|
15 |
|
16 |
# Install Python dependencies in correct order
|
17 |
RUN pip install --no-cache-dir --upgrade pip && \
|
18 |
+
# Install numpy<2 first for compatibility
|
19 |
+
pip install --no-cache-dir 'numpy<2' && \
|
20 |
+
# Install PyTorch and other core dependencies
|
21 |
pip install --no-cache-dir \
|
22 |
torch==2.1.0 \
|
23 |
torchvision==0.16.0 \
|
24 |
+
ninja \
|
25 |
+
'transformers>=4.37.0' \
|
|
|
|
|
|
|
|
|
26 |
accelerate \
|
27 |
qwen-vl-utils[decord]==0.0.8 \
|
28 |
fastapi \
|
29 |
uvicorn[standard] \
|
30 |
python-multipart \
|
31 |
pillow \
|
32 |
+
pydantic \
|
33 |
+
supervision && \
|
34 |
+
# Install AutoAWQ last
|
35 |
+
pip install --no-cache-dir autoawq
|
36 |
|
37 |
# Copy application files
|
38 |
COPY --chown=user:user . /app
|
39 |
|
40 |
+
# Create required directories and set permissions
|
41 |
RUN mkdir -p /home/user/.cache/huggingface && \
|
42 |
mkdir -p /temp && \
|
43 |
chown -R user:user /home/user/.cache && \
|
|
|
50 |
ENV HOME=/home/user \
|
51 |
PATH=/home/user/.local/bin:$PATH \
|
52 |
TRANSFORMERS_CACHE=/home/user/.cache/huggingface \
|
53 |
+
TORCH_HOME=/home/user/.cache/torch \
|
54 |
+
HF_HOME=/home/user/.cache/huggingface
|
55 |
|
56 |
# Expose the port
|
57 |
EXPOSE 7860
|