|
|
FROM python:3.10-slim |
|
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1 |
|
|
ENV PYTHONUNBUFFERED=1 |
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y git build-essential |
|
|
|
|
|
|
|
|
COPY . /app |
|
|
|
|
|
|
|
|
RUN pip install --upgrade pip |
|
|
RUN pip install -r requirements.txt |
|
|
|
|
|
|
|
|
|
|
|
RUN python -c "from transformers import AutoTokenizer, AutoModelForSeq2SeqLM; AutoTokenizer.from_pretrained('Helsinki-NLP/opus-mt-en-ar'); AutoModelForSeq2SeqLM.from_pretrained('Helsinki-NLP/opus-mt-en-ar')" |
|
|
|
|
|
|
|
|
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app", "--workers", "1", "--threads", "4", "--timeout", "300"] |
|
|
|