File size: 1,270 Bytes
4800ee4
 
 
 
2843355
 
 
4800ee4
 
 
 
 
 
08e9897
 
 
 
20333be
 
 
 
2843355
 
904b6ba
 
4800ee4
37253ef
ad491af
 
 
4800ee4
 
8e6d05f
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
FROM python:3.9

WORKDIR /code

# Install wget
RUN apt-get update && apt-get install -y wget

# Copy the requirements.txt file into the container at /code/requirements.txt
COPY ./requirements.txt /code/requirements.txt

# Install the Python packages specified in requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt

# Set the environment variable for the transformers cache
ENV TRANSFORMERS_CACHE=/code/cache/huggingface/transformers
ENV HF_HOME=/code/cache/huggingface

# Create the cache directory with correct permissions
RUN mkdir -p /code/cache/huggingface/transformers && \
    chmod -R 777 /code/cache/huggingface

# Download the llama-2-7b-chat.ggmlv3.q8_0.bin model file into the container
# Replace the URL below with the actual URL from where the model file should be downloaded
RUN wget -O /code/llama-2-7b-chat.ggmlv3.q8_0.bin https://huggingface.co/TheBloke/Llama-2-7B-Chat-GGML/resolve/main/llama-2-7b-chat.ggmlv3.q8_0.bin

# Copy the main.py script into the container
COPY ./main.py /code/main.py
COPY ./model_on_cli.py /code/model_on_cli.py
COPY ./db_faiss /code/db_faiss


# Set the command to run the Uvicorn server, serving the app defined in main.py
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]