Spaces:
Runtime error
Runtime error
Create dockerfile
#3
by
dgzambrx99
- opened
- dockerfile +46 -0
dockerfile
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use the official CUDA Debian base image from NVIDIA
|
| 2 |
+
FROM nvidia/cuda:11.2.2-devel-ubuntu20.04
|
| 3 |
+
|
| 4 |
+
# Set environment variables to avoid interactive prompts during package installation
|
| 5 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
| 6 |
+
|
| 7 |
+
# Install Python and system dependencies
|
| 8 |
+
RUN apt-get update && apt-get install -y \
|
| 9 |
+
python3.10 \
|
| 10 |
+
python3-pip \
|
| 11 |
+
build-essential \
|
| 12 |
+
wget \
|
| 13 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 14 |
+
|
| 15 |
+
# Create a symlink for python3
|
| 16 |
+
RUN ln -s /usr/bin/python3.10 /usr/bin/python
|
| 17 |
+
|
| 18 |
+
# Upgrade pip
|
| 19 |
+
RUN python -m pip install --upgrade pip
|
| 20 |
+
|
| 21 |
+
# Install Python dependencies
|
| 22 |
+
RUN pip install torch==2.0.0+cu118
|
| 23 |
+
torchvision==0.15.1+cu118 --extra-index-url https://download.pytorch.org/whl/cu118 \
|
| 24 |
+
python-slugify \
|
| 25 |
+
uuid \
|
| 26 |
+
peft==0.7.1 \
|
| 27 |
+
huggingface-hub==0.23.4 \
|
| 28 |
+
diffusers==0.29.2 \
|
| 29 |
+
transformers==4.42.3 \
|
| 30 |
+
accelerate==0.31.0 \
|
| 31 |
+
safetensors==0.4.3 \
|
| 32 |
+
prodigyopt==1.0 \
|
| 33 |
+
hf-transfer==0.1.4 \
|
| 34 |
+
datasets==2.20.0
|
| 35 |
+
|
| 36 |
+
# Copy your application code to the container
|
| 37 |
+
COPY . /app
|
| 38 |
+
|
| 39 |
+
# Set the working directory to /app
|
| 40 |
+
WORKDIR /app
|
| 41 |
+
|
| 42 |
+
# Specify the command to run your application
|
| 43 |
+
CMD ["python", "app.py"]
|
| 44 |
+
|
| 45 |
+
# Expose any ports the app will run on
|
| 46 |
+
EXPOSE 7860
|