Update pages/3_numeracy.py
Browse files- 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 |
-
|
370 |
-
|
371 |
-
next_response= st.session_state['lessonList1'][st.session_state['msg_index1']+1]
|
372 |
|
373 |
-
|
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['
|
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
|