rairo commited on
Commit
7a44486
·
verified ·
1 Parent(s): fc8098c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -8
app.py CHANGED
@@ -166,18 +166,20 @@ elif tabs == 'Reports':
166
  # Display filtered DataFrame
167
  st.write("Filtered DataFrame")
168
  with st.expander("Preview"):
169
- st.write(filtered_df)
170
- prompt = """
 
171
  You are an expert business analyst. Analyze the following data and generate a comprehensive and insightful business report, including appropriate key perfomance indicators and reccomendations.
172
 
173
  data:
174
  """ + str(calculate_kpis(filtered_df)) + str(get_pandas_profile(filtered_df))
175
 
176
- response = model.generate_content(prompt)
177
- report = response.text
178
- st.markdown(report)
179
- else:
180
- st.write("Filtered DataFrame")
181
- st.write("Click 'Apply Filters' to see the filtered data.")
 
182
 
183
 
 
166
  # Display filtered DataFrame
167
  st.write("Filtered DataFrame")
168
  with st.expander("Preview"):
169
+ st.write(filtered_df.head())
170
+ with st.spinner("Generating Report, Please Wait...."):
171
+ prompt = """
172
  You are an expert business analyst. Analyze the following data and generate a comprehensive and insightful business report, including appropriate key perfomance indicators and reccomendations.
173
 
174
  data:
175
  """ + str(calculate_kpis(filtered_df)) + str(get_pandas_profile(filtered_df))
176
 
177
+ response = model.generate_content(prompt)
178
+ report = response.text
179
+ st.markdown(report)
180
+ st.success("Report Generated!")
181
+ else:
182
+ st.write("Filtered DataFrame")
183
+ st.write("Click 'Apply Filters' to see the filtered data.")
184
 
185