From ec534d965d2073f70f099b7ba0b409c3e34c8c1a Mon Sep 17 00:00:00 2001 From: Rahmani mohamed rami <123117552+Ramyrahmeni@users.noreply.github.com> Date: Sun, 16 Jun 2024 12:04:28 +0100 Subject: [PATCH] fixing design --- app.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app.py b/app.py index 5ef0a2d..11cab0c 100644 --- a/app.py +++ b/app.py @@ -318,7 +318,6 @@ def ask(query, embedding_model, embeddings, pages_and_chunks): Question: {query} Answer: """ - st.text(f"Prompt: {prompt}") gemini_response = st.session_state.chat_session.send_message(prompt) @@ -340,10 +339,7 @@ def ask(query, embedding_model, embeddings, pages_and_chunks): def main(): st.header("Chat with PDF 💬") - st.write("\n\n") - for message in st.session_state.chat_session.history: - with st.chat_message(translate_role_for_streamlit(message.role)): - st.markdown(message.parts[0].text) + MAX_UPLOAD_SIZE_MB = 30 MAX_UPLOAD_SIZE_BYTES = MAX_UPLOAD_SIZE_MB * 1024 * 1024 @@ -393,6 +389,10 @@ def main(): rep=ask(query,embedding_model,st.session_state.embeddings,pages_and_chunks) with st.chat_message("assistant"): st.markdown(rep.text) + st.write("\n\n") + for message in st.session_state.chat_session.history: + with st.chat_message(translate_role_for_streamlit(message.role)): + st.markdown(message.parts[0].text) if __name__ == "__main__":