Spaces:
Sleeping
Sleeping
# Use an alias for the base image for easier updates | |
FROM python:3.10 as base | |
# Set model | |
ENV MODEL=gguf/Smaug-34B-v0.1-GGUF | |
ENV QUANT=Q2_K | |
ENV CHAT_TEMPLATE=chatml | |
# Set up a new user named "user" with user ID 1000 | |
RUN useradd -m -u 1000 user | |
USER user | |
ENV HOME=/home/user \ | |
PATH=/home/user/.local/bin:$PATH | |
# Set the working directory to the user's home directory | |
WORKDIR $HOME/app | |
# Install Python requirements | |
COPY ./requirements.txt $HOME/app/ | |
RUN pip install --no-cache-dir --upgrade -r requirements.txt | |
# Download model | |
RUN MODEL_NAME_FILE=$(echo ${MODEL#*/} | tr '[:upper:]' '[:lower:]' | sed 's/-gguf$//') && \ | |
wget https://huggingface.co/gguf/Smaug-34B-v0.1-GGUF/resolve/main/smaug-34b-v0.1.Q2_K.gguf -O model.gguf | |
# Copy the current directory contents into the container at $HOME/app setting the owner to the user | |
COPY --chown=user . $HOME/app | |
# Command to run the application | |
CMD ["python", "app.py"] | |