mouadenna commited on
Commit
5e0defb
1 Parent(s): d2c3e97

Update pages/3_numeracy.py

Browse files
Files changed (1) hide show
  1. pages/3_numeracy.py +4 -12
pages/3_numeracy.py CHANGED
@@ -366,24 +366,16 @@ def main():
366
 
367
  if 0 <= st.session_state['msg_index1'] < len(st.session_state['lessonList1']):
368
  response = st.session_state['lessonList1'][st.session_state['msg_index1']]
369
- go =False
370
- try:
371
- next_response= st.session_state['lessonList1'][st.session_state['msg_index1']+1]
372
 
373
- if next_response.strip().startswith("image:"):
374
-
375
- st.session_state['img_prompt1'] = next_response[len("image:"):].strip()
376
- except:
377
- go=True
378
- pass
379
-
380
- if go:
381
  audio_bytes= tts_predict(response)
382
  st.session_state['messages1'].append(f"Mo3alimi: {response}")
383
  #auto_play(audio_bytes,wait=True,lag=0.25,key=None)
384
  st.audio(audio_bytes, format='audio/wav', autoplay=True)
385
 
386
- st.session_state['msg_index1'] += 1
387
  else:
388
 
389
  st.session_state['msg_index1'] = 0
 
366
 
367
  if 0 <= st.session_state['msg_index1'] < len(st.session_state['lessonList1']):
368
  response = st.session_state['lessonList1'][st.session_state['msg_index1']]
369
+ if response.strip().startswith("image:"):
370
+ st.session_state['img_prompt1'] = response[len("image:"):].strip()
 
371
 
372
+ else:
 
 
 
 
 
 
 
373
  audio_bytes= tts_predict(response)
374
  st.session_state['messages1'].append(f"Mo3alimi: {response}")
375
  #auto_play(audio_bytes,wait=True,lag=0.25,key=None)
376
  st.audio(audio_bytes, format='audio/wav', autoplay=True)
377
 
378
+ st.session_state['msg_index'] += 1
379
  else:
380
 
381
  st.session_state['msg_index1'] = 0