Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -19,7 +19,8 @@ def solve(problem_text):
|
|
| 19 |
return "// Error: Problem text too short."
|
| 20 |
|
| 21 |
# UPDATED PROMPT: Explicitly forbid comments
|
| 22 |
-
|
|
|
|
| 23 |
inputs = tokenizer(prompt, return_tensors="pt")
|
| 24 |
|
| 25 |
with torch.no_grad():
|
|
|
|
| 19 |
return "// Error: Problem text too short."
|
| 20 |
|
| 21 |
# UPDATED PROMPT: Explicitly forbid comments
|
| 22 |
+
# We ask for a step-by-step algorithm to prevent one-liners, but still ban comments
|
| 23 |
+
prompt = f"Problem:\n{problem_text}\n\nWrite a complete, robust, step-by-step Python3 algorithm to solve this. DO NOT include any comments, docstrings, or conversational text. Only output the raw code.\nPython code solution:\n"
|
| 24 |
inputs = tokenizer(prompt, return_tensors="pt")
|
| 25 |
|
| 26 |
with torch.no_grad():
|