Skip to content

Commit

Permalink
fixing design
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramyrahmeni committed Jun 16, 2024
1 parent 380bea7 commit ec534d9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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

Expand Down Expand Up @@ -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__":
Expand Down

0 comments on commit ec534d9

Please sign in to comment.