shubhendu-ghosh commited on
Commit
dcfb64b
1 Parent(s): cc17fdc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -18
app.py CHANGED
@@ -75,26 +75,21 @@ def user_input(user_question):
75
  , return_only_outputs=True)
76
 
77
  print(response)
78
- st.write("Reply: ", response["output_text"])
 
79
 
80
 
81
 
82
  def main():
83
- st.set_page_config("Chat PDF")
84
- st.markdown(
85
- """
86
- <style>
87
- .reportview-container {
88
- background: #fff;
89
- }
90
- </style>
91
- """,
92
- unsafe_allow_html=True,
93
- )
94
- st.header("Chat with PDF using Gemini💁")
95
 
 
 
 
 
 
96
  # Text input for user question
97
- user_question = st.text_input("Ask a Question from the PDF Files")
 
98
 
99
  # If user inputs a question, process it
100
  if user_question:
@@ -102,16 +97,16 @@ def main():
102
 
103
  # Sidebar menu
104
  with st.sidebar:
105
- st.title("Menu:")
106
  # File uploader for PDF files
107
- pdf_docs = st.file_uploader("Upload your PDF Files and Click on the Submit & Process Button", accept_multiple_files=True)
108
  # Button to submit and process PDF files
109
- if st.button("Submit & Process"):
110
  with st.spinner("Processing..."):
111
  raw_text = get_pdf_text(pdf_docs)
112
  text_chunks = get_text_chunks(raw_text)
113
  get_vector_store(text_chunks)
114
- st.success("Done")
115
 
116
  if __name__ == "__main__":
117
  main()
 
75
  , return_only_outputs=True)
76
 
77
  print(response)
78
+
79
+ st.markdown(f"""<p style="color: #0352ff;font-size: 15px;font-family: sans-serif; text-align:left;margin-bottom: 0px; height: 5px">{response["output_text"]}</p>""", unsafe_allow_html=True)
80
 
81
 
82
 
83
  def main():
 
 
 
 
 
 
 
 
 
 
 
 
84
 
85
+
86
+ # Set page config and header
87
+ st.set_page_config("Chat PDF")
88
+ st.markdown("""<p style="color: #0352ff;font-size: 70px;font-family: arial; text-align:center; margin-bottom: 0px;" ><b>POLY</b><span style="color: #ec11f7;font-size: 70px;font-family: arial;"><b>DOCS</b></span></p>""", unsafe_allow_html=True)
89
+ st.markdown("""<p style="color: #0352ff;font-size: 30px;font-family: sans-serif; text-align:center; margin-bottom: 50px;">chatbot powered by google gemini </p>""", unsafe_allow_html=True)
90
  # Text input for user question
91
+ st.markdown("""<p style="color: #0352ff;font-size: 15px;font-family: sans-serif; text-align:left;margin-bottom: 0px; height: 5px">Ask a Question from the PDF Files </p>""", unsafe_allow_html=True)
92
+ user_question = st.text_input("")
93
 
94
  # If user inputs a question, process it
95
  if user_question:
 
97
 
98
  # Sidebar menu
99
  with st.sidebar:
100
+ st.title("Menu")
101
  # File uploader for PDF files
102
+ pdf_docs = st.file_uploader("Upload your PDF Files and Click on the Submit Button", accept_multiple_files=True)
103
  # Button to submit and process PDF files
104
+ if st.button("Submit"):
105
  with st.spinner("Processing..."):
106
  raw_text = get_pdf_text(pdf_docs)
107
  text_chunks = get_text_chunks(raw_text)
108
  get_vector_store(text_chunks)
109
+ st.success("Uploaded")
110
 
111
  if __name__ == "__main__":
112
  main()