Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +9 -10
Dockerfile
CHANGED
|
@@ -1,12 +1,15 @@
|
|
| 1 |
# Use NVIDIA CUDA image for GPU acceleration
|
| 2 |
FROM nvidia/cuda:12.1.1-cudnn8-devel-ubuntu22.04
|
| 3 |
|
| 4 |
-
# Set environment variables
|
| 5 |
ENV DEBIAN_FRONTEND=noninteractive \
|
| 6 |
HF_HOME=/app/.cache/huggingface \
|
| 7 |
TRANSFORMERS_CACHE=/app/.cache/huggingface \
|
| 8 |
TORCH_HOME=/app/.cache/torch \
|
| 9 |
-
TRITON_DISABLE="1"
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
# Install system dependencies
|
| 12 |
RUN apt-get update && apt-get install -y \
|
|
@@ -16,8 +19,9 @@ RUN apt-get update && apt-get install -y \
|
|
| 16 |
# Set working directory
|
| 17 |
WORKDIR /app
|
| 18 |
|
| 19 |
-
# Create necessary directories with proper permissions
|
| 20 |
RUN mkdir -p /app/.cache/huggingface /app/.cache/torch && chmod -R 777 /app/.cache
|
|
|
|
| 21 |
|
| 22 |
# Create and activate virtual environment
|
| 23 |
RUN python3 -m venv venv
|
|
@@ -29,14 +33,9 @@ RUN pip install --no-cache-dir --upgrade pip setuptools wheel
|
|
| 29 |
# Install PyTorch separately
|
| 30 |
RUN pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
|
| 31 |
|
| 32 |
-
# Install other dependencies
|
| 33 |
-
RUN pip install --no-cache-dir transformers
|
| 34 |
-
RUN pip install --no-cache-dir accelerate
|
| 35 |
-
RUN pip install --no-cache-dir fastapi uvicorn
|
| 36 |
RUN pip install --no-cache-dir bitsandbytes
|
| 37 |
-
RUN pip install --no-cache-dir huggingface_hub
|
| 38 |
-
RUN pip install --no-cache-dir protobuf
|
| 39 |
-
RUN pip install --no-cache-dir optimum
|
| 40 |
|
| 41 |
# Expose API port
|
| 42 |
EXPOSE 7860
|
|
|
|
| 1 |
# Use NVIDIA CUDA image for GPU acceleration
|
| 2 |
FROM nvidia/cuda:12.1.1-cudnn8-devel-ubuntu22.04
|
| 3 |
|
| 4 |
+
# Set environment variables - note the additional ones to disable Triton
|
| 5 |
ENV DEBIAN_FRONTEND=noninteractive \
|
| 6 |
HF_HOME=/app/.cache/huggingface \
|
| 7 |
TRANSFORMERS_CACHE=/app/.cache/huggingface \
|
| 8 |
TORCH_HOME=/app/.cache/torch \
|
| 9 |
+
TRITON_DISABLE="1" \
|
| 10 |
+
BNB_DISABLE_TRITON="1" \
|
| 11 |
+
USE_TORCH="1" \
|
| 12 |
+
BITSANDBYTES_NOWELCOME="1"
|
| 13 |
|
| 14 |
# Install system dependencies
|
| 15 |
RUN apt-get update && apt-get install -y \
|
|
|
|
| 19 |
# Set working directory
|
| 20 |
WORKDIR /app
|
| 21 |
|
| 22 |
+
# Create necessary directories with proper permissions - try creating /.triton too
|
| 23 |
RUN mkdir -p /app/.cache/huggingface /app/.cache/torch && chmod -R 777 /app/.cache
|
| 24 |
+
RUN mkdir -p /.triton && chmod 777 /.triton
|
| 25 |
|
| 26 |
# Create and activate virtual environment
|
| 27 |
RUN python3 -m venv venv
|
|
|
|
| 33 |
# Install PyTorch separately
|
| 34 |
RUN pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
|
| 35 |
|
| 36 |
+
# Install other dependencies
|
| 37 |
+
RUN pip install --no-cache-dir transformers accelerate fastapi uvicorn huggingface_hub protobuf
|
|
|
|
|
|
|
| 38 |
RUN pip install --no-cache-dir bitsandbytes
|
|
|
|
|
|
|
|
|
|
| 39 |
|
| 40 |
# Expose API port
|
| 41 |
EXPOSE 7860
|