Cylanoid commited on
Commit
9da3a16
·
verified ·
1 Parent(s): 1219b28

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -15
Dockerfile CHANGED
@@ -1,21 +1,19 @@
1
- FROM docker.io/nvidia/cuda:12.3.2-cudnn9-devel-ubuntu22.04@sha256:fb1ad20f2552f5b3aafb2c9c478ed57da95e2bb027d15218d7a55b3a0e4b4413
 
2
 
3
- WORKDIR /app
4
-
5
- COPY requirements.txt .
6
-
7
- # Set environment variable to disable build isolation
8
- ENV PIP_NO_BUILD_ISOLATION=1
9
 
10
- # Install torch FIRST, before flash-attn
11
- RUN pip install --no-cache-dir torch
 
12
 
13
- # VERIFY torch installation
14
- RUN python -c "import torch; print(torch.__version__)"
15
-
16
- # Now install all other requirements, including flash-attn
17
- RUN pip install --no-cache-dir -r requirements.txt
18
 
19
- COPY . .
 
20
 
 
21
  CMD ["python", "app.py"]
 
1
+ # Use an official Python runtime as the base image
2
+ FROM python:3.10
3
 
4
+ # Install torch first to make it available for other packages' build processes
5
+ RUN pip install torch
 
 
 
 
6
 
7
+ # Copy requirements.txt and install remaining dependencies
8
+ COPY requirements.txt /tmp/requirements.txt
9
+ RUN pip install --no-cache-dir -r /tmp/requirements.txt
10
 
11
+ # Copy your application code to the container
12
+ COPY . /app
13
+ WORKDIR /app
 
 
14
 
15
+ # Expose the port (default for Gradio/Hugging Face Spaces is 7860)
16
+ EXPOSE 7860
17
 
18
+ # Command to run your application (adjust 'app.py' to your main script)
19
  CMD ["python", "app.py"]