mainfile cgpt 4
Browse files
app.py
CHANGED
@@ -70,7 +70,7 @@ def create_conversational_qa_chain(retriever, condense_llm, answer_llm):
|
|
70 |
) | CONDENSE_QUESTION_PROMPT | condense_llm
|
71 |
|
72 |
retrieval_chain = RunnableLambda(
|
73 |
-
lambda x:
|
74 |
) | retriever | _combine_documents
|
75 |
|
76 |
answer_chain = ANSWER_PROMPT | answer_llm
|
@@ -136,8 +136,8 @@ def app():
|
|
136 |
"chat_history": chistory,
|
137 |
}
|
138 |
)
|
139 |
-
st.write(response)
|
140 |
-
message = {"role": "assistant", "content": response}
|
141 |
st.session_state.messages.append(message)
|
142 |
|
143 |
if __name__ == '__main__':
|
|
|
70 |
) | CONDENSE_QUESTION_PROMPT | condense_llm
|
71 |
|
72 |
retrieval_chain = RunnableLambda(
|
73 |
+
lambda x: x['standalone_question']
|
74 |
) | retriever | _combine_documents
|
75 |
|
76 |
answer_chain = ANSWER_PROMPT | answer_llm
|
|
|
136 |
"chat_history": chistory,
|
137 |
}
|
138 |
)
|
139 |
+
st.write(response['generate_answer'])
|
140 |
+
message = {"role": "assistant", "content": response['generate_answer']}
|
141 |
st.session_state.messages.append(message)
|
142 |
|
143 |
if __name__ == '__main__':
|