Update pages/3_numeracy.py
Browse files- pages/3_numeracy.py +4 -6
pages/3_numeracy.py
CHANGED
@@ -70,7 +70,6 @@ os.environ["GEMINI_API_KEY"] = "AIzaSyBYZ_7geqmnK6xrSe268-1nSLeuEwbzmTA"
|
|
70 |
|
71 |
# Initial prompt to send to the model
|
72 |
initial_prompt = """
|
73 |
-
|
74 |
You're a Numeracy Instructor for Adults your objective is to teach illiterate adults basic numeracy skills starting with numbers and progressing to basic arithmetic.
|
75 |
## Here's the Lesson Instructions:
|
76 |
Introduction to Numbers:",
|
@@ -106,8 +105,7 @@ Provide positive reinforcement and encouragement.
|
|
106 |
##Continuation:
|
107 |
Once the lesson for the number 1 is complete, proceed to the next number following the same four-step structure.
|
108 |
## Important I want it in a python list, you have to do it accordingly, and generate one lesson at a time. so when you recieve "next" move to the next lesson, for exemple the first lesson for number 1, second for number 2 when you finish with numbers move to simple numeracy operations
|
109 |
-
## so now start with number 1
|
110 |
-
|
111 |
"""
|
112 |
|
113 |
chat_prompt_mistral="""
|
@@ -147,7 +145,7 @@ def transform_history(history):
|
|
147 |
|
148 |
def generate_response(message: str, history: list) -> tuple:
|
149 |
genai.configure(api_key=os.environ["GEMINI_API_KEY"])
|
150 |
-
model = genai.GenerativeModel('gemini-
|
151 |
chat = model.start_chat(history=transform_history(history))
|
152 |
response = chat.send_message(message)
|
153 |
response.resolve()
|
@@ -375,7 +373,7 @@ def main():
|
|
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['
|
379 |
else:
|
380 |
|
381 |
st.session_state['msg_index1'] = 0
|
@@ -416,7 +414,7 @@ def main():
|
|
416 |
|
417 |
|
418 |
with col2:
|
419 |
-
if '
|
420 |
st.session_state['img_path1']=get_image(st.session_state['img_prompt1'])
|
421 |
del st.session_state['img_prompt1']
|
422 |
|
|
|
70 |
|
71 |
# Initial prompt to send to the model
|
72 |
initial_prompt = """
|
|
|
73 |
You're a Numeracy Instructor for Adults your objective is to teach illiterate adults basic numeracy skills starting with numbers and progressing to basic arithmetic.
|
74 |
## Here's the Lesson Instructions:
|
75 |
Introduction to Numbers:",
|
|
|
105 |
##Continuation:
|
106 |
Once the lesson for the number 1 is complete, proceed to the next number following the same four-step structure.
|
107 |
## Important I want it in a python list, you have to do it accordingly, and generate one lesson at a time. so when you recieve "next" move to the next lesson, for exemple the first lesson for number 1, second for number 2 when you finish with numbers move to simple numeracy operations
|
108 |
+
## so now start with number 1
|
|
|
109 |
"""
|
110 |
|
111 |
chat_prompt_mistral="""
|
|
|
145 |
|
146 |
def generate_response(message: str, history: list) -> tuple:
|
147 |
genai.configure(api_key=os.environ["GEMINI_API_KEY"])
|
148 |
+
model = genai.GenerativeModel('gemini-pro')
|
149 |
chat = model.start_chat(history=transform_history(history))
|
150 |
response = chat.send_message(message)
|
151 |
response.resolve()
|
|
|
373 |
#auto_play(audio_bytes,wait=True,lag=0.25,key=None)
|
374 |
st.audio(audio_bytes, format='audio/wav', autoplay=True)
|
375 |
|
376 |
+
st.session_state['msg_index1'] += 1
|
377 |
else:
|
378 |
|
379 |
st.session_state['msg_index1'] = 0
|
|
|
414 |
|
415 |
|
416 |
with col2:
|
417 |
+
if 'img_prompt1' in st.session_state:
|
418 |
st.session_state['img_path1']=get_image(st.session_state['img_prompt1'])
|
419 |
del st.session_state['img_prompt1']
|
420 |
|