Suguru1846 commited on
Commit
6a5e569
·
verified ·
1 Parent(s): 9e83766

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -10
Dockerfile CHANGED
@@ -1,6 +1,6 @@
1
  FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04
2
 
3
- # Environment variables
4
  ENV DEBIAN_FRONTEND=noninteractive \
5
  HF_HOME=/tmp/hf_cache \
6
  TRANSFORMERS_CACHE=/tmp/hf_cache \
@@ -8,23 +8,29 @@ ENV DEBIAN_FRONTEND=noninteractive \
8
  TRITON_DISABLE="1" \
9
  BNB_DISABLE_TRITON="1" \
10
  USE_TORCH="1" \
11
- BITSANDBYTES_NOWELCOME="1"
12
-
13
- ENV HF_TOKEN=""
14
 
 
15
  RUN apt-get update && apt-get install -y \
16
- git wget curl \
17
  && rm -rf /var/lib/apt/lists/*
18
 
 
 
 
 
 
19
  WORKDIR /app
20
 
 
21
  RUN mkdir -p /tmp/hf_cache && chmod -R 777 /tmp/hf_cache
22
 
23
- RUN pip install --no-cache-dir --upgrade pip setuptools wheel
24
- RUN pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
25
- RUN pip install --no-cache-dir transformers accelerate fastapi uvicorn huggingface_hub protobuf
26
- RUN pip install --no-cache-dir scipy
27
- RUN pip install --no-cache-dir bitsandbytes
28
 
29
  # Expose API port
30
  EXPOSE 7860
 
1
  FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04
2
 
3
+ # Set environment variables
4
  ENV DEBIAN_FRONTEND=noninteractive \
5
  HF_HOME=/tmp/hf_cache \
6
  TRANSFORMERS_CACHE=/tmp/hf_cache \
 
8
  TRITON_DISABLE="1" \
9
  BNB_DISABLE_TRITON="1" \
10
  USE_TORCH="1" \
11
+ BITSANDBYTES_NOWELCOME="1" \
12
+ HF_TOKEN=""
 
13
 
14
+ # Install system dependencies including Python and pip
15
  RUN apt-get update && apt-get install -y \
16
+ git wget curl python3 python3-pip python3-dev \
17
  && rm -rf /var/lib/apt/lists/*
18
 
19
+ # Make sure pip is properly linked
20
+ RUN ln -sf /usr/bin/python3 /usr/bin/python && \
21
+ ln -sf /usr/bin/pip3 /usr/bin/pip
22
+
23
+ # Set working directory
24
  WORKDIR /app
25
 
26
+ # Create cache directories with proper permissions
27
  RUN mkdir -p /tmp/hf_cache && chmod -R 777 /tmp/hf_cache
28
 
29
+ # Install packages directly
30
+ RUN python -m pip install --no-cache-dir --upgrade pip setuptools wheel
31
+ RUN python -m pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
32
+ RUN python -m pip install --no-cache-dir transformers accelerate fastapi uvicorn huggingface_hub protobuf
33
+ RUN python -m pip install --no-cache-dir scipy bitsandbytes
34
 
35
  # Expose API port
36
  EXPOSE 7860