Spaces:
Runtime error
Runtime error
File size: 809 Bytes
6bce6bf |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# Use an official Python image as a base
FROM python:3.10
# Set the working directory
WORKDIR /app
# Copy requirements and install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
ENV TRANSFORMERS_CACHE=/app/cache
# Copy the application code
COPY . .
# Download the Hugging Face model during the build process
# RUN python -c "from transformers import AutoTokenizer, AutoModelForCausalLM; \
# model_path = 'model/models--meta-llama--Llama-3.2-3B-Instruct/snapshots/0cb88a4f764b7a12671c53f0838cd831a0843b95'; \
# AutoTokenizer.from_pretrained(model_path); \
# AutoModelForCausalLM.from_pretrained(model_path)"
# Expose the default port
EXPOSE 7860
# Start the FastAPI app using Uvicorn
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] |