JPLTedCas commited on
Commit
730194c
verified
1 Parent(s): 165f5e4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -80,7 +80,7 @@ def get_conversation_chain(vectorstore:FAISS) -> ConversationalRetrievalChain:
80
 
81
 
82
  def handle_userinput(user_question:str):
83
- response = st.session_state.conversation({"question": user_question})
84
  st.session_state.chat_history = response["chat_history"]
85
 
86
  for i, message in enumerate(st.session_state.chat_history):
@@ -96,8 +96,8 @@ def main():
96
  page_icon=":books:",
97
  )
98
 
99
- st.markdown("# Chat with a Bot")
100
- st.markdown("This bot tries to answer questions about multiple PDFs. Let the processing of the PDF finish before adding your question. 馃檹馃従")
101
 
102
  st.write(css, unsafe_allow_html=True)
103
 
@@ -108,20 +108,20 @@ def main():
108
  st.session_state.chat_history = None
109
 
110
 
111
- st.header("Chat with a Bot 馃馃 that tries to answer questions about multiple PDFs :books:")
112
- user_question = st.text_input("Ask a question about your documents:")
113
  if user_question:
114
  handle_userinput(user_question)
115
 
116
 
117
  with st.sidebar:
118
  add_logo()
119
- st.subheader("Your documents")
120
  pdf_docs = st.file_uploader(
121
- "Upload your PDFs here and click on 'Process'", accept_multiple_files=True
122
  )
123
- if st.button("Process"):
124
- with st.spinner("Processing"):
125
  # get pdf text
126
  raw_text = get_pdf_text(pdf_docs)
127
 
 
80
 
81
 
82
  def handle_userinput(user_question:str):
83
+ response = st.session_state.conversation({"pregunta": user_question})
84
  st.session_state.chat_history = response["chat_history"]
85
 
86
  for i, message in enumerate(st.session_state.chat_history):
 
96
  page_icon=":books:",
97
  )
98
 
99
+ st.markdown("# Charla con TedCasBot")
100
+ st.markdown("Este Bot ser谩 tu aliado a la hora de buscar informaci贸n en m煤ltiples documentos pdf. D茅janos ayudarte! 馃檹馃従")
101
 
102
  st.write(css, unsafe_allow_html=True)
103
 
 
108
  st.session_state.chat_history = None
109
 
110
 
111
+ st.header("Charla con un Bot 馃馃 que te ayudar谩 a responder preguntas sobre tus pdfs:")
112
+ user_question = st.text_input("Haz tu pregunta!:")
113
  if user_question:
114
  handle_userinput(user_question)
115
 
116
 
117
  with st.sidebar:
118
  add_logo()
119
+ st.subheader("Tus documentos")
120
  pdf_docs = st.file_uploader(
121
+ "Sube tus documentos y haz click en 'Procesar'", accept_multiple_files=True
122
  )
123
+ if st.button("Procesar"):
124
+ with st.spinner("Procesando"):
125
  # get pdf text
126
  raw_text = get_pdf_text(pdf_docs)
127