File size: 1,234 Bytes
2ae746c
 
72249cb
2ae746c
 
72249cb
2ae746c
 
 
72249cb
2ae746c
 
 
 
 
72249cb
 
2ae746c
 
 
 
72249cb
2ae746c
 
 
 
 
72249cb
2ae746c
 
 
72249cb
2ae746c
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Loading base. I'm using Debian, u can use whatever u want.
FROM python:3.11.5-slim-bookworm

# Just for sure everything will be fine.
USER root

# Installing gcc compiler and main library.
RUN apt update && apt install gcc cmake build-essential -y
RUN CMAKE_ARGS="-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS" pip install llama-cpp-python

# Copying files into folder and making it working dir.
RUN mkdir app
COPY . /app
RUN chmod -R 777 /app
WORKDIR /app


# Installing wget and downloading model.
ADD https://huggingface.co/TheBloke/dolphin-2.2.1-AshhLimaRP-Mistral-7B-GGUF/resolve/main/dolphin-2.2.1-ashhlimarp-mistral-7b.Q4_K_M.gguf /app/model.bin
RUN chmod -R 777 /app/model.bin
# You can use other models! Or u can comment this two RUNs and include in Space/repo/Docker image own model with name "model.bin".

# Fixing warnings from Transformers and Matplotlib
RUN mkdir -p /.cache/huggingface/hub -m 777
RUN mkdir -p /.config/matplotlib -m 777
RUN chmod -R 777 /.cache 
RUN chmod -R 777 /.config

# Updating pip and installing everything from requirements
RUN python3 -m pip install -U pip setuptools wheel
RUN pip install --upgrade -r /app/requirements.txt

# Now it's time to run Gradio app!
CMD ["python", "gradio_app.py"]