Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -63,7 +63,7 @@ def chat(user_input, history):
|
|
63 |
explanation_messages = [
|
64 |
{
|
65 |
"role": "system",
|
66 |
-
"content": "
|
67 |
},
|
68 |
{
|
69 |
"role": "user",
|
@@ -73,7 +73,7 @@ def chat(user_input, history):
|
|
73 |
explanation = llm_inference(explanation_messages)
|
74 |
|
75 |
# Step 2: Generate Python Code using Explanation and User Prompt
|
76 |
-
code_prompt = f"Based on the following explanation, write a Python program to solve the mathematical task. Ensure that the program includes a print statement to output the answer
|
77 |
|
78 |
code_messages = [
|
79 |
{
|
|
|
63 |
explanation_messages = [
|
64 |
{
|
65 |
"role": "system",
|
66 |
+
"content": "Provide a very small explanation on how to approach the following mathematical task without calculating the answer."
|
67 |
},
|
68 |
{
|
69 |
"role": "user",
|
|
|
73 |
explanation = llm_inference(explanation_messages)
|
74 |
|
75 |
# Step 2: Generate Python Code using Explanation and User Prompt
|
76 |
+
code_prompt = f"Based on the following explanation, write a Python program to solve the mathematical task using Python. Ensure that the program includes a print statement to output the answer. Write only code. Writing any comments or anything else is prohibited. \n\nExplanation: {explanation}\n\nTask: {user_input}"
|
77 |
|
78 |
code_messages = [
|
79 |
{
|