vsj0702 commited on
Commit
b46518b
Β·
verified Β·
1 Parent(s): 2619b5c

added waiting response for narrator

Browse files
Files changed (1) hide show
  1. chatbot.py +4 -0
chatbot.py CHANGED
@@ -149,12 +149,16 @@ def render_chatbot(code, output, error):
149
  # πŸ”Š Speak
150
  speak_btn = st.button(f"πŸ”Š Narrate #{i+1}")
151
  if speak_btn:
 
152
  bot = CodeAssistantBot()
153
  narration = bot.narrate_response(code, output, error, a, st.session_state.chat_summary)
 
154
  audio_filename = f"audio_{uuid.uuid4().hex}.mp3"
155
  asyncio.run(text_to_speech(narration, audio_filename))
 
156
  st.audio(audio_filename, format="audio/mp3", autoplay=True)
157
 
 
158
  if start > 0 and st.button("πŸ”½ Show more"):
159
  st.session_state.chat_display_count += 5
160
  st.rerun()
 
149
  # πŸ”Š Speak
150
  speak_btn = st.button(f"πŸ”Š Narrate #{i+1}")
151
  if speak_btn:
152
+ status_placeholder.info("🧠 Generating narration...")
153
  bot = CodeAssistantBot()
154
  narration = bot.narrate_response(code, output, error, a, st.session_state.chat_summary)
155
+ status_placeholder.info("πŸŽ™οΈ Converting to audio...")
156
  audio_filename = f"audio_{uuid.uuid4().hex}.mp3"
157
  asyncio.run(text_to_speech(narration, audio_filename))
158
+ status_placeholder.success("πŸ”Š Narration ready!")
159
  st.audio(audio_filename, format="audio/mp3", autoplay=True)
160
 
161
+
162
  if start > 0 and st.button("πŸ”½ Show more"):
163
  st.session_state.chat_display_count += 5
164
  st.rerun()