Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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({"
|
| 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("#
|
| 100 |
-
st.markdown("
|
| 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("
|
| 112 |
-
user_question = st.text_input("
|
| 113 |
if user_question:
|
| 114 |
handle_userinput(user_question)
|
| 115 |
|
| 116 |
|
| 117 |
with st.sidebar:
|
| 118 |
add_logo()
|
| 119 |
-
st.subheader("
|
| 120 |
pdf_docs = st.file_uploader(
|
| 121 |
-
"
|
| 122 |
)
|
| 123 |
-
if st.button("
|
| 124 |
-
with st.spinner("
|
| 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 |
|