Skip to content

Commit

Permalink
Add bearer auth support to rag
Browse files Browse the repository at this point in the history
Signed-off-by: thepetk <[email protected]>
  • Loading branch information
thepetk committed Sep 23, 2024
1 parent 9af5be0 commit 9a4a08e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion recipes/natural_language_processing/rag/app/rag_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

model_service = os.getenv("MODEL_ENDPOINT","http://0.0.0.0:8001")
model_service = f"{model_service}/v1"
model_service_bearer = os.getenv("MODEL_ENDPOINT_BEARER")
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")
Expand Down Expand Up @@ -75,7 +76,7 @@ def read_file(file):


llm = ChatOpenAI(base_url=model_service,
api_key="EMPTY",
api_key="EMPTY" if model_service_bearer is None else model_service_bearer,
model=model_name,
streaming=True,
callbacks=[StreamlitCallbackHandler(st.container(),
Expand Down

0 comments on commit 9a4a08e

Please sign in to comment.