Chandranshu Jain commited on
Commit
6f8c5b6
1 Parent(s): 3fd640b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -19
app.py CHANGED
@@ -90,23 +90,16 @@ def embedding(chunk,query):
90
 
91
 
92
 
93
-
94
- def main():
95
- st.header("Chat with your pdf💁")
96
- st.title("Menu:")
97
- with st.sidebar:
98
- st.title("PDF FILE UPLOAD:")
99
- pdf_docs = st.file_uploader("Upload your PDF File and Click on the Submit & Process Button", accept_multiple_files=False, key="pdf_uploader")
100
 
101
- query = st.text_input("Ask a Question from the PDF File", key="query")
102
- if st.button("Submit & Process", key="process_button"):
103
- with st.spinner("Processing..."):
104
- raw_text = get_pdf(pdf_docs)
105
- text_chunks = text_splitter(raw_text)
106
- if query:
107
- embedding(text_chunks,query)
108
- st.success("Done")
109
-
110
-
111
- if __name__ == "__main__":
112
- main()
 
90
 
91
 
92
 
93
+ st.header("Chat with your pdf💁")
94
+ with st.sidebar:
95
+ st.title("PDF FILE UPLOAD:")
96
+ pdf_docs = st.file_uploader("Upload your PDF File and Click on the Submit & Process Button", accept_multiple_files=False, key="pdf_uploader")
 
 
 
97
 
98
+ query = st.text_input("Ask a Question from the PDF File", key="query")
99
+ if st.button("Submit & Process", key="process_button"):
100
+ with st.spinner("Processing..."):
101
+ raw_text = get_pdf(pdf_docs)
102
+ text_chunks = text_splitter(raw_text)
103
+ if query:
104
+ embedding(text_chunks,query)
105
+ st.success("Done")