From c68bb3b95043f0ce816adc68c3876e485b9fe77c Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Sun, 7 Jan 2024 08:28:35 -0800 Subject: [PATCH] docker: slim --- Dockerfile | 4 ++-- backend/apps/rag/main.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index aa6c3d552..88cfc6b93 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,7 @@ RUN npm ci COPY . . RUN npm run build -FROM python:3.11-bookworm as base +FROM python:3.11-slim-bookworm as base ENV ENV=prod @@ -28,7 +28,7 @@ WORKDIR /app/backend COPY ./backend/requirements.txt ./requirements.txt RUN pip3 install -r requirements.txt -RUN python -c "from sentence_transformers import SentenceTransformer; model = SentenceTransformer('all-MiniLM-L6-v2')" +# RUN python -c "from sentence_transformers import SentenceTransformer; model = SentenceTransformer('all-MiniLM-L6-v2')" COPY ./backend . diff --git a/backend/apps/rag/main.py b/backend/apps/rag/main.py index a59aac6cb..f9553a603 100644 --- a/backend/apps/rag/main.py +++ b/backend/apps/rag/main.py @@ -11,7 +11,7 @@ from fastapi import ( from fastapi.middleware.cors import CORSMiddleware import os, shutil -from chromadb.utils import embedding_functions +# from chromadb.utils import embedding_functions from langchain_community.document_loaders import WebBaseLoader, TextLoader, PyPDFLoader from langchain.text_splitter import RecursiveCharacterTextSplitter @@ -29,9 +29,9 @@ from utils.utils import get_current_user from config import UPLOAD_DIR, EMBED_MODEL, CHROMA_CLIENT, CHUNK_SIZE, CHUNK_OVERLAP from constants import ERROR_MESSAGES -EMBEDDING_FUNC = embedding_functions.SentenceTransformerEmbeddingFunction( - model_name=EMBED_MODEL -) +# EMBEDDING_FUNC = embedding_functions.SentenceTransformerEmbeddingFunction( +# model_name=EMBED_MODEL +# ) app = FastAPI()