alishafique commited on
Commit
2adb19d
·
verified ·
1 Parent(s): 02acb8a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -25
Dockerfile CHANGED
@@ -1,29 +1,14 @@
1
- ARG CUDA_IMAGE="12.1.1-devel-ubuntu22.04"
2
- FROM nvidia/cuda:${CUDA_IMAGE}
3
 
4
  # We need to set the host to 0.0.0.0 to allow outside access
5
  ENV HOST 0.0.0.0
6
 
7
- RUN apt-get update && apt-get upgrade -y \
8
- && apt-get install -y git build-essential \
9
- python3 python3-pip gcc wget \
10
- ocl-icd-opencl-dev opencl-headers clinfo \
11
- libclblast-dev libopenblas-dev \
12
- && mkdir -p /etc/OpenCL/vendors && echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd
13
-
14
- COPY . .
15
-
16
- # setting build related env
17
- # ENV CUDA_DOCKER_ARCH=all
18
- # ENV LLAMA_CUBLAS=1
19
-
20
- # Install depencencies
21
  RUN python3 -m pip install --upgrade pip pytest cmake \
22
  scikit-build setuptools fastapi uvicorn sse-starlette \
23
  pydantic-settings starlette-context gradio huggingface_hub hf_transfer
24
 
25
- # Install llama-cpp-python (build with cuda)
26
- # RUN CMAKE_ARGS="-DGGML_CUDA=on -DCMAKE_CUDA_ARCHITECTURES=75" FORCE_CMAKE=1 python3 -m pip install llama-cpp-python --force-reinstall --upgrade --no-cache-dir --verbose
27
  RUN python3 -m pip install llama-cpp-python
28
 
29
  RUN useradd -m -u 1000 user
@@ -31,14 +16,14 @@ RUN useradd -m -u 1000 user
31
  USER user
32
  # Set home to the user's home directory
33
  ENV HOME=/home/user \
34
- PATH=/home/user/.local/bin:$PATH \
35
  PYTHONPATH=$HOME/app \
36
- PYTHONUNBUFFERED=1 \
37
- GRADIO_ALLOW_FLAGGING=never \
38
- GRADIO_NUM_PORTS=1 \
39
- GRADIO_SERVER_NAME=0.0.0.0 \
40
- GRADIO_THEME=huggingface \
41
- SYSTEM=spaces
42
 
43
  WORKDIR $HOME/app
44
 
 
1
+ FROM python:3.10
 
2
 
3
  # We need to set the host to 0.0.0.0 to allow outside access
4
  ENV HOST 0.0.0.0
5
 
6
+ # Install dependencies
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  RUN python3 -m pip install --upgrade pip pytest cmake \
8
  scikit-build setuptools fastapi uvicorn sse-starlette \
9
  pydantic-settings starlette-context gradio huggingface_hub hf_transfer
10
 
11
+ # Install llama-cpp-python for CPU
 
12
  RUN python3 -m pip install llama-cpp-python
13
 
14
  RUN useradd -m -u 1000 user
 
16
  USER user
17
  # Set home to the user's home directory
18
  ENV HOME=/home/user \
19
+ PATH=/home/user/.local/bin:$PATH \
20
  PYTHONPATH=$HOME/app \
21
+ PYTHONUNBUFFERED=1 \
22
+ GRADIO_ALLOW_FLAGGING=never \
23
+ GRADIO_NUM_PORTS=1 \
24
+ GRADIO_SERVER_NAME=0.0.0.0 \
25
+ GRADIO_THEME=huggingface \
26
+ SYSTEM=spaces
27
 
28
  WORKDIR $HOME/app
29