Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -53,19 +53,16 @@ def get_conversational_chain(Fvs):
|
|
| 53 |
prompt = PromptTemplate(template = prompt_template, input_variables = ["context", "question"])
|
| 54 |
memory = ConversationBufferMemory(memory_key = "chat_history", return_messages=True)
|
| 55 |
chain = ConversationalRetrievalChain.from_llm(llm=model,retriever=Fvs.as_retriever(), memory=memory)
|
| 56 |
-
|
| 57 |
return chain
|
| 58 |
|
| 59 |
-
|
| 60 |
-
|
| 61 |
def user_input(user_question):
|
| 62 |
response = st.session_state.conversation({'question': user_question})
|
| 63 |
st.session_state.chatHistory = response['chat_history']
|
| 64 |
for i, message in enumerate(st.session_state.chatHistory):
|
| 65 |
if i%2 == 0:
|
| 66 |
-
st.write("
|
| 67 |
else:
|
| 68 |
-
st.write("
|
| 69 |
|
| 70 |
## streamlit app
|
| 71 |
st.set_page_config("Chat With Multiple PDF")
|
|
|
|
| 53 |
prompt = PromptTemplate(template = prompt_template, input_variables = ["context", "question"])
|
| 54 |
memory = ConversationBufferMemory(memory_key = "chat_history", return_messages=True)
|
| 55 |
chain = ConversationalRetrievalChain.from_llm(llm=model,retriever=Fvs.as_retriever(), memory=memory)
|
|
|
|
| 56 |
return chain
|
| 57 |
|
|
|
|
|
|
|
| 58 |
def user_input(user_question):
|
| 59 |
response = st.session_state.conversation({'question': user_question})
|
| 60 |
st.session_state.chatHistory = response['chat_history']
|
| 61 |
for i, message in enumerate(st.session_state.chatHistory):
|
| 62 |
if i%2 == 0:
|
| 63 |
+
st.write("π¨βπ¬π¨βπ¬: ", message.content)
|
| 64 |
else:
|
| 65 |
+
st.write("π€π€: ", message.content)
|
| 66 |
|
| 67 |
## streamlit app
|
| 68 |
st.set_page_config("Chat With Multiple PDF")
|