toxicity-api / Dockerfile
TuTGo's picture
Update Dockerfile
b261731 verified
Raw
History Blame Contribute Delete
590 Bytes
FROM python:3.9
WORKDIR /code
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
# Automatically download your massive model bypassing the 1GB limit!
RUN pip install huggingface-hub
RUN python -c "from huggingface_hub import hf_hub_download; hf_hub_download(repo_id='TuTGo/toxic-model', filename='toxic_xlmr.tflite', local_dir='.')"
RUN python -c "from huggingface_hub import hf_hub_download; hf_hub_download(repo_id='TuTGo/toxic-model', filename='sentencepiece.bpe.model', local_dir='.')"
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]