yarb / Dockerfile
yazied49's picture
Update Dockerfile
5e44ace verified
raw
history blame contribute delete
898 Bytes
FROM python:3.10-slim
WORKDIR /app
# ุซุจุช ุงู„ู…ูƒุชุจุงุช ุงู„ู…ุทู„ูˆุจุฉ
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# ุฌู‡ุฒ ู…ุฌู„ุฏ ุงู„ูƒุงุด ูˆุตู„ุงุญูŠุงุชู‡
RUN mkdir -p /app/cache
RUN chmod -R 777 /app/cache
ENV TRANSFORMERS_CACHE=/app/cache
# ู‚ุจู„ ุชุญู…ูŠู„ ุงู„ู…ูˆุฏูŠู„ ู†ู…ุณุญ ู…ู„ูุงุช ุงู„ู‚ูู„ ุงู„ู‚ุฏูŠู…ุฉ ู„ูˆ ู…ูˆุฌูˆุฏุฉ
RUN find /app/cache -name '*.lock' -type f -delete
# ุญู…ู‘ู„ ุงู„ู…ูˆุฏูŠู„ ูˆุงู„ู…ูƒุชุจุฉ ู‚ุจู„ ุชุดุบูŠู„ ุงู„ุชุทุจูŠู‚ ู„ุชู‚ู„ูŠู„ ูˆู‚ุช ุจุฏุก ุงู„ุชุดุบูŠู„
RUN python -c "from transformers import AutoTokenizer, AutoModelForCausalLM; AutoTokenizer.from_pretrained('microsoft/BioGPT-Large'); AutoModelForCausalLM.from_pretrained('microsoft/BioGPT-Large')"
# ุงู†ุณุฎ ู…ู„ูุงุช ุงู„ุชุทุจูŠู‚
COPY . .
# ุดุบู‘ู„ ุงู„ุชุทุจูŠู‚
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]