mouadenna commited on
Commit
bc864b5
1 Parent(s): 9bad76b

Update pages/3_numeracy.py

Browse files
Files changed (1) hide show
  1. pages/3_numeracy.py +8 -2
pages/3_numeracy.py CHANGED
@@ -366,8 +366,14 @@ 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
- if response.strip().startswith("image:"):
370
- st.session_state['img_prompt1'] = response[len("image:"):].strip()
 
 
 
 
 
 
371
  else:
372
  audio_bytes= tts_predict(response)
373
  st.session_state['messages1'].append(f"Mo3alimi: {response}")
 
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
+ try:
370
+ next_response= st.session_state['lessonList1'][st.session_state['msg_index1']+1]
371
+
372
+ if next_response.strip().startswith("image:"):
373
+
374
+ st.session_state['img_prompt1'] = next_response[len("image:"):].strip()
375
+ except:
376
+ pass
377
  else:
378
  audio_bytes= tts_predict(response)
379
  st.session_state['messages1'].append(f"Mo3alimi: {response}")