Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files12345678910111213141516171819FROM python:3.10-slim# Install system dependenciesRUN apt-get update && apt-get install -y \build-essential \python3-dev \wget \&& rm -rf /var/lib/apt/lists/*# The -q flag makes it quiet so the logs don't hit the 2MB limitRUN wget -q -O model.gguf https://huggingface.co/maddes8cht/mosaicml-mpt-7b-chat-gguf/resolve/main/mosaicml-mpt-7b-chat-Q2_K.gguf# Install modern llama-cpp and web serverRUN pip install --no-cache-dir llama-cpp-python fastapi uvicornCOPY app.py .# Port 7860 is required for Hugging Face SpacesCMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]1234567891011121314151617181920FROM python:3.10-slim# Install wget to get the modelRUN apt-get update && apt-get install -y wget && rm -rf /var/lib/apt/lists/*# 1. Download the GGUF model (Quiet mode)RUN wget -q -O model.gguf https://huggingface.co/maddes8cht/mosaicml-mpt-7b-chat-gguf/resolve/main/mosaicml-mpt-7b-chat-Q2_K.gguf# 2. Install llama-cpp-python using a PRE-BUILT wheel# This skips the "Building wheel" phase and finishes in secondsRUN pip install --no-cache-dir \https://huggingface.co/Luigi/llama-cpp-python-wheels-hf-spaces-free-cpu/resolve/main/llama_cpp_python-0.3.22-cp310-cp310-linux_x86_64.whl# 3. Install web server basicsRUN pip install --no-cache-dir fastapi uvicornCOPY app.py .# Port 7860 for Hugging FaceCMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
Dockerfile+11-10