Update app.py
Browse files
app.py
CHANGED
|
@@ -64,6 +64,14 @@ st.write("Upload your invoice (image or PDF)")
|
|
| 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")
|
| 68 |
|
| 69 |
if uploaded_file is not None:
|
|
@@ -81,13 +89,6 @@ You are an expert in understanding invoices. We will show you an invoice and you
|
|
| 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)
|
|
|
|
| 64 |
# Display sample prompts
|
| 65 |
|
| 66 |
uploaded_file = st.file_uploader("Upload an Invoice Image 🖼️ or PDF 📄", type=["jpg", "jpeg", "png", "pdf"])
|
| 67 |
+
|
| 68 |
+
selected = sp.pills(" Ask a question related to the invoice. Here are some example prompts:",
|
| 69 |
+
["What is the total amount?",
|
| 70 |
+
'What are the Customter details?' ,
|
| 71 |
+
'What is the information about the Products?'],
|
| 72 |
+
clearable=True,index=None)
|
| 73 |
+
if selected:
|
| 74 |
+
input_query = selected
|
| 75 |
input_query = st.text_input("Ask a question about the invoice", key="input")
|
| 76 |
|
| 77 |
if uploaded_file is not None:
|
|
|
|
| 89 |
|
| 90 |
if submit:
|
| 91 |
file_data = input_file_setup(uploaded_file)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
response = get_gemini_response(input_prompt, file_data, input_query)
|
| 93 |
st.subheader("Response🤖:")
|
| 94 |
st.write(response)
|