Spaces:
Sleeping
Sleeping
sandrocalzada
commited on
Commit
•
d04be14
1
Parent(s):
f48d655
Update app.py
Browse files
app.py
CHANGED
@@ -49,7 +49,7 @@ def handle_query(query):
|
|
49 |
chat_text_qa_msgs = [
|
50 |
(
|
51 |
"user",
|
52 |
-
"""You are a Q&A assistant. Your main goal is to provide answers as accurately as possible, based on the instructions and context you have been given. If a question does not match the provided context or is outside the scope of the document, kindly advise the user to ask questions within the context of the document. Provides the answers in Spanish and cite the page where the answers
|
53 |
Context:
|
54 |
{context_str}
|
55 |
Question:
|
@@ -71,7 +71,7 @@ def handle_query(query):
|
|
71 |
|
72 |
|
73 |
# Streamlit app initialization
|
74 |
-
st.title("(PDF) Chat con documentos🗞️")
|
75 |
st.markdown("Retrieval-Augmented Generation")
|
76 |
st.markdown("iniciar chat ...🚀")
|
77 |
|
@@ -79,6 +79,7 @@ if 'messages' not in st.session_state:
|
|
79 |
st.session_state.messages = [{'role': 'assistant', "content": 'Hola! Selecciona un pdf para cargar, y hazme una pregunta.'}]
|
80 |
|
81 |
with st.sidebar:
|
|
|
82 |
st.title("Menu:")
|
83 |
uploaded_file = st.file_uploader("Sube un archivo PDF y dale click al botón enviar y procesar.")
|
84 |
if st.button("Enviar y Procesar"):
|
@@ -98,4 +99,4 @@ if user_prompt:
|
|
98 |
|
99 |
for message in st.session_state.messages:
|
100 |
with st.chat_message(message['role']):
|
101 |
-
st.write(message['content'])
|
|
|
49 |
chat_text_qa_msgs = [
|
50 |
(
|
51 |
"user",
|
52 |
+
"""You are a Q&A assistant. Your main goal is to provide answers as accurately as possible, based on the instructions and context you have been given. If a question does not match the provided context or is outside the scope of the document, kindly advise the user to ask questions within the context of the document. Provides the answers in Spanish and cite the page and section where the answers were found.
|
53 |
Context:
|
54 |
{context_str}
|
55 |
Question:
|
|
|
71 |
|
72 |
|
73 |
# Streamlit app initialization
|
74 |
+
st.title("(PDF) Chat con documentos de Procesos 🗞️")
|
75 |
st.markdown("Retrieval-Augmented Generation")
|
76 |
st.markdown("iniciar chat ...🚀")
|
77 |
|
|
|
79 |
st.session_state.messages = [{'role': 'assistant', "content": 'Hola! Selecciona un pdf para cargar, y hazme una pregunta.'}]
|
80 |
|
81 |
with st.sidebar:
|
82 |
+
st.image('image_logo.jpeg', use_column_width=True) # Display the company logo at the top of the sidebar
|
83 |
st.title("Menu:")
|
84 |
uploaded_file = st.file_uploader("Sube un archivo PDF y dale click al botón enviar y procesar.")
|
85 |
if st.button("Enviar y Procesar"):
|
|
|
99 |
|
100 |
for message in st.session_state.messages:
|
101 |
with st.chat_message(message['role']):
|
102 |
+
st.write(message['content'])
|