From 1e242de51d945118495d272c2e70b29f0503cd14 Mon Sep 17 00:00:00 2001 From: leehk Date: Fri, 7 Mar 2025 13:01:39 +0800 Subject: [PATCH] update .env default --- app/docker-compose.yml | 3 +-- app/streamlit/Chatbot.py | 14 +++++++------- app/streamlit/Dockerfile | 10 +++++++++- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/app/docker-compose.yml b/app/docker-compose.yml index fb7640a..d217c56 100644 --- a/app/docker-compose.yml +++ b/app/docker-compose.yml @@ -3,8 +3,7 @@ version: "3.9" services: streamlit: build: ./streamlit - platform: linux/amd64 ports: - "8501:8501" volumes: - - ./llmops/src/rag_cot/chroma_db:/app/llmops/src/rag_cot/chroma_db + - ./llmops/src/rag_cot_evaluation/chroma_db:/app/llmops/src/rag_cot_evaluation/chroma_db diff --git a/app/streamlit/Chatbot.py b/app/streamlit/Chatbot.py index 3e16323..ce971e5 100644 --- a/app/streamlit/Chatbot.py +++ b/app/streamlit/Chatbot.py @@ -16,13 +16,13 @@ torch.classes.__path__ = [os.path.join(torch.__path__[0], torch.classes.__file__ os.environ["TOKENIZERS_PARALLELISM"] = "false" -GEMINI_API_KEY = config("GOOGLE_API_KEY", cast=str) -DEEKSEEK_API_KEY = config("DEEKSEEK_API_KEY", cast=str) -MOONSHOT_API_KEY = config("MOONSHOT_API_KEY", cast=str) -CHAT_MODEL_PROVIDER = config("CHAT_MODEL_PROVIDER", cast=str) -INPUT_CHROMADB_LOCAL = config("INPUT_CHROMADB_LOCAL", cast=str) -EMBEDDING_MODEL = config("EMBEDDING_MODEL", cast=str) -COLLECTION_NAME = config("COLLECTION_NAME", cast=str) +GEMINI_API_KEY = config("GOOGLE_API_KEY", cast=str, default="123456") +DEEKSEEK_API_KEY = config("DEEKSEEK_API_KEY", cast=str, default="123456") +MOONSHOT_API_KEY = config("MOONSHOT_API_KEY", cast=str, default="123456") +CHAT_MODEL_PROVIDER = config("CHAT_MODEL_PROVIDER", cast=str, default="gemini") +INPUT_CHROMADB_LOCAL = config("INPUT_CHROMADB_LOCAL", cast=str, default="../llmops/src/rag_cot_evaluation/chroma_db") +EMBEDDING_MODEL = config("EMBEDDING_MODEL", cast=str, default="paraphrase-multilingual-mpnet-base-v2") +COLLECTION_NAME = config("COLLECTION_NAME", cast=str, default="rag_experiment") st.title("💬 RAG AI for Medical Guideline") st.caption(f"🚀 A RAG AI for Medical Guideline powered by {CHAT_MODEL_PROVIDER}") diff --git a/app/streamlit/Dockerfile b/app/streamlit/Dockerfile index b335644..b7456d5 100644 --- a/app/streamlit/Dockerfile +++ b/app/streamlit/Dockerfile @@ -2,6 +2,12 @@ FROM python:3.11-slim WORKDIR /app/streamlit +RUN apt-get update && apt-get install -y \ + build-essential \ + curl \ + software-properties-common \ + && rm -rf /var/lib/apt/lists/* + COPY requirements.txt ./ RUN pip install --no-cache-dir -r requirements.txt @@ -11,4 +17,6 @@ COPY .env . EXPOSE 8501 -ENTRYPOINT ["streamlit", "run", "Chatbot.py"] \ No newline at end of file +HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health + +ENTRYPOINT ["streamlit", "run", "Chatbot.py", "--server.port=8501", "--server.address=0.0.0.0"] \ No newline at end of file