From 3a25158aa3abce9ece5df36e86b7a03a1d0c8cad Mon Sep 17 00:00:00 2001 From: Maysun J Faisal Date: Fri, 9 Aug 2024 17:51:01 -0400 Subject: [PATCH] Configure model for rag recipe Signed-off-by: Maysun J Faisal --- recipes/natural_language_processing/rag/app/rag_app.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes/natural_language_processing/rag/app/rag_app.py b/recipes/natural_language_processing/rag/app/rag_app.py index fde09b1b..756e2745 100644 --- a/recipes/natural_language_processing/rag/app/rag_app.py +++ b/recipes/natural_language_processing/rag/app/rag_app.py @@ -12,6 +12,7 @@ model_service = os.getenv("MODEL_ENDPOINT","http://0.0.0.0:8001") model_service = f"{model_service}/v1" +model_name = os.getenv("MODEL_NAME", "") chunk_size = os.getenv("CHUNK_SIZE", 150) embedding_model = os.getenv("EMBEDDING_MODEL","BAAI/bge-base-en-v1.5") vdb_vendor = os.getenv("VECTORDB_VENDOR", "chromadb") @@ -75,6 +76,7 @@ def read_file(file): llm = ChatOpenAI(base_url=model_service, api_key="EMPTY", + model=model_name, streaming=True, callbacks=[StreamlitCallbackHandler(st.container(), collapse_completed_thoughts=True)])