Update Dockerfile
Browse files4 unmodified lines5678910114 unmodified lines1617181920212223246 unmodified lines313233343536374 unmodified linesWORKDIR /app# Install Python dependencies (added huggingface_hub which includes the CLI)RUN pip install --no-cache-dir flask flask-cors Pillow litert-lm huggingface_hub# Create dummy Vulkan library to satisfy litert-lm on CPU4 unmodified lines# Create model directoryRUN mkdir -p /app/models/gemma# --- KEY CHANGE: Download the model during the Docker build ---# This bakes the model into your Hugging Face Space imageRUN huggingface-cli download litert-community/gemma-4-E2B-it-litert-lm gemma-4-E2B-it.litertlm --local-dir /app/models/gemma# Copy the server codeCOPY server.py .6 unmodified lines# Set environment variablesENV PORT=7860ENV LD_LIBRARY_PATH=/app# --- KEY CHANGE: Point the Python script directly to the baked-in model ---ENV GEMMA_MODEL_PATH=/app/models/gemma/gemma-4-E2B-it.litertlmEXPOSE 78604 unmodified lines5678910114 unmodified lines16171819202122236 unmodified lines3031323334354 unmodified linesWORKDIR /app# Install Python dependenciesRUN pip install --no-cache-dir flask flask-cors Pillow litert-lm huggingface_hub# Create dummy Vulkan library to satisfy litert-lm on CPU4 unmodified lines# Create model directoryRUN mkdir -p /app/models/gemma# --- KEY FIX: Use the new 'hf' command instead of 'huggingface-cli' ---RUN hf download litert-community/gemma-4-E2B-it-litert-lm gemma-4-E2B-it.litertlm --local-dir /app/models/gemma# Copy the server codeCOPY server.py .6 unmodified lines# Set environment variablesENV PORT=7860ENV LD_LIBRARY_PATH=/appENV GEMMA_MODEL_PATH=/app/models/gemma/gemma-4-E2B-it.litertlmEXPOSE 7860
Dockerfile+3-5