Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -82,7 +82,8 @@ def solve_problem(problem, max_iterations, reward_threshold, swift_model_id, sag
|
|
| 82 |
)
|
| 83 |
|
| 84 |
reasoning, solution, messages = s2.solve(problem, max_iterations, reward_threshold)
|
| 85 |
-
|
|
|
|
| 86 |
# generate HTML for the log messages and display them with wrap and a scroll bar and a max height in the code block with log style
|
| 87 |
|
| 88 |
log_messages = "<pre style='white-space: pre-wrap; max-height: 500px; overflow-y: scroll;'><code class='log'>" + "\n".join(messages) + "</code></pre>"
|
|
|
|
| 82 |
)
|
| 83 |
|
| 84 |
reasoning, solution, messages = s2.solve(problem, max_iterations, reward_threshold)
|
| 85 |
+
reasoning = reasoning.replace("The generated code is:", "\n---\nThe generated code is:").strip()
|
| 86 |
+
solution = solution.replace("Answer (from running the code):\n ", " ").strip()
|
| 87 |
# generate HTML for the log messages and display them with wrap and a scroll bar and a max height in the code block with log style
|
| 88 |
|
| 89 |
log_messages = "<pre style='white-space: pre-wrap; max-height: 500px; overflow-y: scroll;'><code class='log'>" + "\n".join(messages) + "</code></pre>"
|