|
|
|
|
|
FROM python:3.10-slim
|
|
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y \
|
|
|
git \
|
|
|
wget \
|
|
|
build-essential \
|
|
|
libopenblas-dev \
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
|
COPY requirements.txt .
|
|
|
|
|
|
|
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
|
RUN python - <<EOF
|
|
|
from sentence_transformers import SentenceTransformer, CrossEncoder
|
|
|
print("Downloading embedding model...")
|
|
|
SentenceTransformer("sentence-transformers/paraphrase-multilingual-mpnet-base-v2")
|
|
|
print("Downloading intent model...")
|
|
|
SentenceTransformer("all-MiniLM-L6-v2")
|
|
|
print("Downloading reranker model...")
|
|
|
CrossEncoder("cross-encoder/ms-marco-MiniLM-L-12-v2")
|
|
|
print("All models cached.")
|
|
|
EOF
|
|
|
|
|
|
|
|
|
EXPOSE 7860
|
|
|
|
|
|
|
|
|
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|