Spaces:
Sleeping
Sleeping
dinhquangson
commited on
Commit
•
683ac4d
1
Parent(s):
15c6902
Update app.py
Browse files
app.py
CHANGED
@@ -159,15 +159,9 @@ def main():
|
|
159 |
os.environ["HUGGINGFACEHUB_API_TOKEN"] = huggingface_token
|
160 |
#os.environ["OPENAI_API_KEY"] = openai_api_key
|
161 |
|
162 |
-
st.session_state.conversation={}
|
163 |
if "chat_history" not in st.session_state:
|
164 |
st.session_state.chat_history = None
|
165 |
|
166 |
-
st.header("Chat with a Bot 🤖🦾 that tries to answer questions about multiple PDFs :books:")
|
167 |
-
user_question = st.text_input("Ask a question about your documents:")
|
168 |
-
if user_question:
|
169 |
-
handle_userinput(user_question)
|
170 |
-
|
171 |
with st.sidebar:
|
172 |
st.subheader("Your documents")
|
173 |
pdf_docs = st.file_uploader(
|
@@ -187,6 +181,11 @@ def main():
|
|
187 |
# create conversation chain
|
188 |
st.session_state.conversation = get_conversation_chain(vectorstore)
|
189 |
|
|
|
|
|
|
|
|
|
|
|
190 |
|
191 |
if __name__ == "__main__":
|
192 |
main()
|
|
|
159 |
os.environ["HUGGINGFACEHUB_API_TOKEN"] = huggingface_token
|
160 |
#os.environ["OPENAI_API_KEY"] = openai_api_key
|
161 |
|
|
|
162 |
if "chat_history" not in st.session_state:
|
163 |
st.session_state.chat_history = None
|
164 |
|
|
|
|
|
|
|
|
|
|
|
165 |
with st.sidebar:
|
166 |
st.subheader("Your documents")
|
167 |
pdf_docs = st.file_uploader(
|
|
|
181 |
# create conversation chain
|
182 |
st.session_state.conversation = get_conversation_chain(vectorstore)
|
183 |
|
184 |
+
st.header("Chat with a Bot 🤖🦾 that tries to answer questions about multiple PDFs :books:")
|
185 |
+
user_question = st.text_input("Ask a question about your documents:")
|
186 |
+
if user_question:
|
187 |
+
handle_userinput(user_question)
|
188 |
+
|
189 |
|
190 |
if __name__ == "__main__":
|
191 |
main()
|