bai-granite / Dockerfile
Pratham Bhat
Pull the model before starting the container
0252e20
raw
history blame
559 Bytes
FROM python:3.9
WORKDIR /code
RUN mkdir -p /code && chmod -R 777 /code
RUN mkdir -p /.cache && chmod -R 777 /.cache
RUN mkdir -p /.cache/huggingface && chmod -R 777 /.cache/huggingface
COPY ./requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
COPY . .
RUN python3 -c "from transformers import AutoModelForCausalLM; AutoModelForCausalLM.from_pretrained('ibm-granite/granite-34b-code-instruct-8k', cache_dir='/.cache/huggingface')"
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]