pratham0011 commited on
Commit
4004971
·
verified ·
1 Parent(s): 3d61e63

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -12
app.py CHANGED
@@ -59,20 +59,9 @@ def input_file_setup(uploaded_file):
59
  st.set_page_config(page_title="Invoice Information Extractor", page_icon="🔮")
60
  st.title("Invoice Information Extractor 📃")
61
 
62
- st.write("Upload your invoice (image or PDF) and ask a question related to the invoice. Here are some example prompts:")
63
 
64
  # Display sample prompts
65
- st.subheader("Sample Prompts:")
66
- sample_prompts = [
67
- "What is the total amount?",
68
- 'What are the Customter details?' ,
69
- 'What is the information about the Products?'
70
- ]
71
- sp.pills(sample_prompts,
72
- options=Iterable[sample_prompts],
73
- clearable=True,
74
- index=None
75
- )
76
 
77
  uploaded_file = st.file_uploader("Upload an Invoice Image 🖼️ or PDF 📄", type=["jpg", "jpeg", "png", "pdf"])
78
  input_query = st.text_input("Ask a question about the invoice", key="input")
@@ -92,6 +81,13 @@ You are an expert in understanding invoices. We will show you an invoice and you
92
 
93
  if submit:
94
  file_data = input_file_setup(uploaded_file)
 
 
 
 
 
 
 
95
  response = get_gemini_response(input_prompt, file_data, input_query)
96
  st.subheader("Response🤖:")
97
  st.write(response)
 
59
  st.set_page_config(page_title="Invoice Information Extractor", page_icon="🔮")
60
  st.title("Invoice Information Extractor 📃")
61
 
62
+ st.write("Upload your invoice (image or PDF)")
63
 
64
  # Display sample prompts
 
 
 
 
 
 
 
 
 
 
 
65
 
66
  uploaded_file = st.file_uploader("Upload an Invoice Image 🖼️ or PDF 📄", type=["jpg", "jpeg", "png", "pdf"])
67
  input_query = st.text_input("Ask a question about the invoice", key="input")
 
81
 
82
  if submit:
83
  file_data = input_file_setup(uploaded_file)
84
+ selected = sp.pills(" Ask a question related to the invoice. Here are some example prompts:",
85
+ ["What is the total amount?",
86
+ 'What are the Customter details?' ,
87
+ 'What is the information about the Products?'],
88
+ clearable=True,index=None)
89
+ if selected:
90
+ input_query = selected
91
  response = get_gemini_response(input_prompt, file_data, input_query)
92
  st.subheader("Response🤖:")
93
  st.write(response)