Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files1234567891011121314151617181920212223# Using bullseye for better compatibility with build toolsFROM python:3.10-bullseyeWORKDIR /app# Install curl to download the modelRUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*# Fix: This is the magic line that skips the "Building wheel" phase# It pulls a pre-compiled CPU binary for llama-cpp-pythonRUN pip install --no-cache-dir \fastapi \uvicorn \--extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu \llama-cpp-python# Download MPT-7B Q2RUN 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# Copy your backend codeCOPY app.py .EXPOSE 78601234567891011121314151617181920FROM python:3.10-bullseyeWORKDIR /app# Install only the essentialsRUN 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.ggufCOPY app.py .EXPOSE 7860
Dockerfile+8-11