parasmech commited on
Commit
bafa6f7
·
verified ·
1 Parent(s): 7901ed0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -0
app.py CHANGED
@@ -1,5 +1,6 @@
1
  # from backend import ResultPipeline
2
  import streamlit as st
 
3
  def main():
4
  # Just for setting up the title & head bar
5
  st.set_page_config(page_title = "Bill App")
@@ -10,8 +11,22 @@ def main():
10
  submit = st.button("Extract")
11
 
12
  # If a user has submitted the fieles, we need to call our pipeline
 
 
 
 
 
13
 
14
 
 
 
 
 
 
 
 
 
 
15
 
16
  # Calling the main function
17
  if __name__ == "__main__":
 
1
  # from backend import ResultPipeline
2
  import streamlit as st
3
+ from backend import InvoicePipeline
4
  def main():
5
  # Just for setting up the title & head bar
6
  st.set_page_config(page_title = "Bill App")
 
11
  submit = st.button("Extract")
12
 
13
  # If a user has submitted the fieles, we need to call our pipeline
14
+ if submit:
15
+ with st.spinner("Please wait, while we are processing your information..."):
16
+ pipe = InvoicePipeline(files)
17
+ df_results = pipe.run()
18
+ st.write(df_results)
19
 
20
 
21
+ convert_to_csv = df_results.to_csv(index = False).encode("utf-8")
22
+ st.download_button(
23
+ "Download",
24
+ convert_to_csv,
25
+ "bills.csv",
26
+ "text/csv",
27
+ key = "download-csv"
28
+ )
29
+
30
 
31
  # Calling the main function
32
  if __name__ == "__main__":