Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files1123455678891011121314151691011121314151617181920212222FROM python:3.10-bullseye# Use the official pre-compiled image (CPU version)FROM ghcr.io/abetlen/llama-cpp-python:latest
WORKDIR /app
# Install only the essentials# 1. Install curl and move to the right folderRUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
# Force PIP to use CPU-only binaries and avoid the build-stage entirelyENV PIP_PREFER_BINARY=1RUN pip install --no-cache-dir fastapi uvicornRUN pip install llama-cpp-python \ --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
# Download the model (MPT-7B Q2)# We do this AFTER the install so if the model fails, we don't have to reinstall toolsRUN curl -L "https://huggingface.co/maddes8cht/mosaicml-mpt-7b-chat-gguf/resolve/main/mosaicml-mpt-7b-chat-Q2_K.gguf?download=true" -o mpt-7b-q2.gguf# 2. Download the model using the CLI (most stable)RUN pip install huggingface_hubRUN huggingface-cli download maddes8cht/mosaicml-mpt-7b-chat-gguf mosaicml-mpt-7b-chat-Q2_K.gguf --local-dir . --local-dir-use-symlinks FalseRUN mv mosaicml-mpt-7b-chat-Q2_K.gguf mpt-7b-q2.gguf
# 3. Copy your app codeCOPY app.py .
# Force the port to 7860 for Hugging FaceENV PORT=7860EXPOSE 7860
# Use the python inside the container to run your appCMD ["python", "app.py"]CMD ["python3", "app.py"]Dockerfile+12-12