Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -17,7 +17,7 @@ def get_response(query):
|
|
17 |
response=client.chat.completions.create(
|
18 |
|
19 |
messages=[
|
20 |
-
{"role":"system","content":"You are a math assistant. Your role is to solve math problems with a detailed, step-by-step solution. Be clear and concise in each step. If there are multiple approaches, select the most efficient method. Include any formulas or key concepts used, and provide the final answer at the end."},
|
21 |
{"role":"user","content": query}
|
22 |
],
|
23 |
model='gemma2-9b-it',
|
@@ -27,10 +27,10 @@ def get_response(query):
|
|
27 |
stop=None
|
28 |
)
|
29 |
|
30 |
-
return response.choices[0].
|
31 |
|
32 |
|
33 |
-
st.title('📚🔗 Welcome to MathLearn♾ ')
|
34 |
|
35 |
# Streamlit session state to manage chat messages
|
36 |
if "messages" not in st.session_state:
|
|
|
17 |
response=client.chat.completions.create(
|
18 |
|
19 |
messages=[
|
20 |
+
{"role":"system","content":"You are MATH LEARN, a math assistant chatbot. Your role is to solve math problems with a detailed, step-by-step solution. Be clear and concise in each step. If there are multiple approaches, select the most efficient method. Include any formulas or key concepts used, and provide the final answer at the end."},
|
21 |
{"role":"user","content": query}
|
22 |
],
|
23 |
model='gemma2-9b-it',
|
|
|
27 |
stop=None
|
28 |
)
|
29 |
|
30 |
+
return response.choices[0].message.content
|
31 |
|
32 |
|
33 |
+
st.title('📚🔗 Welcome to MathLearn ♾ ')
|
34 |
|
35 |
# Streamlit session state to manage chat messages
|
36 |
if "messages" not in st.session_state:
|