Spaces:
Running
Running
Harikrishna Dev commited on
Commit ·
97f2447
1
Parent(s): 0a924f0
Changing model to gpt-4o due to phase out of gpt-3.5
Browse files
app.py
CHANGED
|
@@ -108,7 +108,7 @@ else:
|
|
| 108 |
|
| 109 |
# Initialize conversational retrieval chain
|
| 110 |
retriever = vectors.as_retriever(search_type="similarity", search_kwargs={"k": 6, "include_metadata": True, "score_threshold": 0.6})
|
| 111 |
-
chain = ConversationalRetrievalChain.from_llm(llm=ChatOpenAI(temperature=0.5, model_name='gpt-
|
| 112 |
retriever=retriever, return_source_documents=True, verbose=True, chain_type="stuff",
|
| 113 |
max_tokens_limit=4097, combine_docs_chain_kwargs={"prompt": prompt})
|
| 114 |
|
|
@@ -152,7 +152,7 @@ if "uuid" not in st.session_state:
|
|
| 152 |
st.session_state["uuid"] = str(uuid.uuid4())
|
| 153 |
|
| 154 |
if "openai_model" not in st.session_state:
|
| 155 |
-
st.session_state["openai_model"] = "gpt-
|
| 156 |
|
| 157 |
if "messages" not in st.session_state:
|
| 158 |
st.session_state.messages = []
|
|
|
|
| 108 |
|
| 109 |
# Initialize conversational retrieval chain
|
| 110 |
retriever = vectors.as_retriever(search_type="similarity", search_kwargs={"k": 6, "include_metadata": True, "score_threshold": 0.6})
|
| 111 |
+
chain = ConversationalRetrievalChain.from_llm(llm=ChatOpenAI(temperature=0.5, model_name='gpt-4o-mini', openai_api_key=openai_api_key),
|
| 112 |
retriever=retriever, return_source_documents=True, verbose=True, chain_type="stuff",
|
| 113 |
max_tokens_limit=4097, combine_docs_chain_kwargs={"prompt": prompt})
|
| 114 |
|
|
|
|
| 152 |
st.session_state["uuid"] = str(uuid.uuid4())
|
| 153 |
|
| 154 |
if "openai_model" not in st.session_state:
|
| 155 |
+
st.session_state["openai_model"] = "gpt-4o-mini"
|
| 156 |
|
| 157 |
if "messages" not in st.session_state:
|
| 158 |
st.session_state.messages = []
|