Spaces:
Running
Running
Fix: use CUDA base image for GPU support
Browse files- Dockerfile +6 -4
Dockerfile
CHANGED
|
@@ -1,8 +1,9 @@
|
|
| 1 |
-
FROM
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
|
|
|
|
| 6 |
ENV HF_HOME=/tmp/hf_cache
|
| 7 |
ENV TRANSFORMERS_CACHE=/tmp/hf_cache
|
| 8 |
ENV TORCH_HOME=/tmp/torch_cache
|
|
@@ -14,7 +15,7 @@ ENV USER=user
|
|
| 14 |
RUN mkdir -p /tmp/hf_cache /tmp/torch_cache /tmp/cache /tmp/home && \
|
| 15 |
chmod -R 777 /tmp/hf_cache /tmp/torch_cache /tmp/cache /tmp/home
|
| 16 |
|
| 17 |
-
RUN
|
| 18 |
torch \
|
| 19 |
transformers \
|
| 20 |
trl \
|
|
@@ -26,4 +27,5 @@ RUN pip install --no-cache-dir \
|
|
| 26 |
COPY train_on_hf.py .
|
| 27 |
RUN chmod -R 777 /app
|
| 28 |
|
| 29 |
-
|
|
|
|
|
|
| 1 |
+
FROM nvidia/cuda:12.1.0-runtime-ubuntu22.04
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
+
RUN apt-get update && apt-get install -y python3 python3-pip && rm -rf /var/lib/apt/lists/*
|
| 6 |
+
|
| 7 |
ENV HF_HOME=/tmp/hf_cache
|
| 8 |
ENV TRANSFORMERS_CACHE=/tmp/hf_cache
|
| 9 |
ENV TORCH_HOME=/tmp/torch_cache
|
|
|
|
| 15 |
RUN mkdir -p /tmp/hf_cache /tmp/torch_cache /tmp/cache /tmp/home && \
|
| 16 |
chmod -R 777 /tmp/hf_cache /tmp/torch_cache /tmp/cache /tmp/home
|
| 17 |
|
| 18 |
+
RUN pip3 install --no-cache-dir \
|
| 19 |
torch \
|
| 20 |
transformers \
|
| 21 |
trl \
|
|
|
|
| 27 |
COPY train_on_hf.py .
|
| 28 |
RUN chmod -R 777 /app
|
| 29 |
|
| 30 |
+
EXPOSE 7860
|
| 31 |
+
CMD ["sh", "-c", "python3 train_on_hf.py --hf-token $HF_TOKEN"]
|