Dhahlan2000 commited on
Commit
8241f94
·
1 Parent(s): 934f12d

Enhance email generation feedback in app.py by adding a loading spinner during the process and a success message upon completion. This improvement provides users with better visual cues while the application generates their emails, contributing to a more engaging and informative user experience.

Browse files
Files changed (1) hide show
  1. app.py +11 -9
app.py CHANGED
@@ -138,15 +138,17 @@ def update_ui(message, cv_file, cv_text):
138
  email_text = ""
139
  # Stream the response
140
  try:
141
- for chunk in conversation_predict(message, cv_text):
142
- if chunk:
143
- email_text += chunk
144
- # Update the text area with each chunk, using timestamp in key
145
- email_placeholder.text_area(
146
- "Generated Email",
147
- value=email_text,
148
- height=400
149
- )
 
 
150
  except Exception as e:
151
  st.error(f"Error during email generation: {str(e)}")
152
  else:
 
138
  email_text = ""
139
  # Stream the response
140
  try:
141
+ with st.spinner('Generating your application email...'):
142
+ for chunk in conversation_predict(message, cv_text):
143
+ if chunk:
144
+ email_text += chunk
145
+ # Update the text area with each chunk, using timestamp in key
146
+ email_placeholder.text_area(
147
+ "Generated Email",
148
+ value=email_text,
149
+ height=400
150
+ )
151
+ st.success('Email generated successfully!')
152
  except Exception as e:
153
  st.error(f"Error during email generation: {str(e)}")
154
  else: