Axcel1 commited on
Commit
5503fad
·
verified ·
1 Parent(s): 764c2d9

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -6
Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- # Use NVIDIA CUDA base image with Python support
2
  FROM nvidia/cuda:12.1.1-runtime-ubuntu22.04
3
 
4
  # Set working directory
@@ -9,6 +9,9 @@ RUN apt-get update && apt-get install -y \
9
  python3.10 \
10
  python3-pip \
11
  python3.10-venv \
 
 
 
12
  git \
13
  curl \
14
  wget \
@@ -16,12 +19,13 @@ RUN apt-get update && apt-get install -y \
16
 
17
  # Make python3.10 the default
18
  RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1
 
19
 
20
  # Upgrade pip
21
  RUN pip install --upgrade pip
22
 
23
- # Install prebuilt llama-cpp-python CUDA wheel (cu121)
24
- RUN pip install --no-cache-dir llama-cpp-python==0.3.0 --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cu121
25
 
26
  # Copy requirements.txt and install remaining dependencies
27
  COPY requirements.txt .
@@ -33,12 +37,13 @@ COPY . .
33
  # Create models directory
34
  RUN mkdir -p models
35
 
36
- # Expose Gradio or web port
37
  EXPOSE 7860
38
 
39
- # Gradio settings
40
  ENV GRADIO_SERVER_NAME="0.0.0.0"
41
  ENV GRADIO_SERVER_PORT=7860
 
42
 
43
  # Start app
44
- CMD ["python", "app.py"]
 
1
+ # Use NVIDIA CUDA base image with Python support (ONLY for GPU Spaces)
2
  FROM nvidia/cuda:12.1.1-runtime-ubuntu22.04
3
 
4
  # Set working directory
 
9
  python3.10 \
10
  python3-pip \
11
  python3.10-venv \
12
+ python3.10-dev \
13
+ build-essential \
14
+ cmake \
15
  git \
16
  curl \
17
  wget \
 
19
 
20
  # Make python3.10 the default
21
  RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1
22
+ RUN update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1
23
 
24
  # Upgrade pip
25
  RUN pip install --upgrade pip
26
 
27
+ # Install prebuilt llama-cpp-python CUDA wheel
28
+ RUN CMAKE_ARGS="-DLLAMA_CUBLAS=on" pip install --no-cache-dir llama-cpp-python==0.2.90 --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cu121
29
 
30
  # Copy requirements.txt and install remaining dependencies
31
  COPY requirements.txt .
 
37
  # Create models directory
38
  RUN mkdir -p models
39
 
40
+ # Expose Gradio port
41
  EXPOSE 7860
42
 
43
+ # Environment variables
44
  ENV GRADIO_SERVER_NAME="0.0.0.0"
45
  ENV GRADIO_SERVER_PORT=7860
46
+ ENV CUDA_VISIBLE_DEVICES=0
47
 
48
  # Start app
49
+ CMD ["python", "app.py"]