Update st.py
Browse files
st.py
CHANGED
@@ -118,6 +118,20 @@ def main():
|
|
118 |
if file_path is not None:
|
119 |
app.load_invoices(file_path)
|
120 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
if st.button("Calculate Interest"):
|
122 |
app.calculate_interest()
|
123 |
|
@@ -125,3 +139,4 @@ def main():
|
|
125 |
|
126 |
if __name__ == "__main__":
|
127 |
main()
|
|
|
|
118 |
if file_path is not None:
|
119 |
app.load_invoices(file_path)
|
120 |
|
121 |
+
query = st.text_input("Enter your query:")
|
122 |
+
if query:
|
123 |
+
# Assuming you have a DataFrame named 'invoices_df' containing the invoice data
|
124 |
+
if not app.invoices_df.empty:
|
125 |
+
# Display the invoice data
|
126 |
+
st.write("Invoice Data:")
|
127 |
+
st.write(app.invoices_df)
|
128 |
+
|
129 |
+
# Call TAPAS model to answer user's query
|
130 |
+
answer = app.ask_tapas(query, app.invoices_df)
|
131 |
+
st.write("Answer:", answer)
|
132 |
+
else:
|
133 |
+
st.warning("Please upload the invoices file first.")
|
134 |
+
|
135 |
if st.button("Calculate Interest"):
|
136 |
app.calculate_interest()
|
137 |
|
|
|
139 |
|
140 |
if __name__ == "__main__":
|
141 |
main()
|
142 |
+
|