Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files12341 unmodified line67891011121314151617181920212223242526272829# Use official pre-compiled binary image to skip building from sourceFROM ghcr.io/abetlen/llama-cpp-python:latestWORKDIR /app1 unmodified line# 1. Install system essentialsRUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*# 2. Install downloader toolRUN pip install --no-cache-dir huggingface_hub# 3. Download MPT-7B Q2 using the module path (Fixes the "not found" error)# This will download the 2.8GB file. If it looks stuck, give it 5-10 minutes!RUN python3 -m huggingface_hub.commands.user download \maddes8cht/mosaicml-mpt-7b-chat-gguf \mosaicml-mpt-7b-chat-Q2_K.gguf \--local-dir . \--local-dir-use-symlinks False# 4. Rename file to match what app.py expectsRUN mv mosaicml-mpt-7b-chat-Q2_K.gguf mpt-7b-q2.gguf# 5. Copy your backend codeCOPY app.py .# Standard Hugging Face configurationENV PORT=7860EXPOSE 786012341 unmodified line67891011121314151617181920212223242526272829# Use the official pre-compiled imageFROM ghcr.io/abetlen/llama-cpp-python:latestWORKDIR /app1 unmodified line# 1. Install system essentialsRUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*# 2. Use 'pip' to call the downloader directly to ensure we use the correct environment# We also use HF_HUB_ENABLE_HF_TRANSFER for much faster downloadsRUN pip install --no-cache-dir huggingface_hub hf_transfer# 3. The Download (Unified command using the 'huggingface-cli' which IS installed by pip)# We set the path explicitly to avoid the 'ModuleNotFoundError'ENV HF_HUB_ENABLE_HF_TRANSFER=1RUN python3 -m huggingface_hub.commands.huggingface_cli download \maddes8cht/mosaicml-mpt-7b-chat-gguf \mosaicml-mpt-7b-chat-Q2_K.gguf \--local-dir .# 4. Rename and CleanupRUN mv mosaicml-mpt-7b-chat-Q2_K.gguf mpt-7b-q2.gguf# 5. Copy your backendCOPY app.py .ENV PORT=7860EXPOSE 7860
Dockerfile+11-11