Spaces:
Sleeping
Sleeping
Download app.py from thisisdev/SimplePDFReader: direct link, hf CLI and curl.
- Browser
- Download file 1.07 kB
-
https://huggingface.co/spaces/thisisdev/SimplePDFReader/resolve/bbeebec99f27694408b1a97ba13f3a25f32b0eab/app.py
- Command line
-
hf download hf://spaces/thisisdev/SimplePDFReader@bbeebec99f27694408b1a97ba13f3a25f32b0eab/app.py
-
curl -L -o app.py https://huggingface.co/spaces/thisisdev/SimplePDFReader/resolve/bbeebec99f27694408b1a97ba13f3a25f32b0eab/app.py
1.07 kB
| # from backend import ResultPipeline | |
| import streamlit as st | |
| from backend import InvoicePipeline | |
| def main(): | |
| # Just for setting up the title & head bar | |
| st.set_page_config(page_title = "Bill App") | |
| st.title("Bill Extractor") | |
| # This section will handle uploadation of files | |
| files = st.file_uploader("Upload the files here..", type = ["pdf"], accept_multiple_files = True) | |
| submit = st.button("Extract") | |
| # If a user has submitted the fieles, we need to call our pipeline | |
| if submit: | |
| with st.spinner("Please wait, while we are processing your information..."): | |
| pipe = InvoicePipeline(files) | |
| df_results = pipe.run() | |
| st.write(df_results) | |
| convert_to_csv = df_results.to_csv(index = False).encode("utf-8") | |
| st.download_button( | |
| "Download", | |
| convert_to_csv, | |
| "bills.csv", | |
| "text/csv", | |
| key = "download-csv" | |
| ) | |
| # Calling the main function | |
| if __name__ == "__main__": | |
| main() |