Spaces:
Sleeping
Sleeping
added backdooring
Browse files
app.py
CHANGED
|
@@ -58,6 +58,7 @@ def majority_vote_with_steps(question, num_iterations=10):
|
|
| 58 |
all_predictions = []
|
| 59 |
all_answers = []
|
| 60 |
steps_list = []
|
|
|
|
| 61 |
|
| 62 |
for _ in range(num_iterations):
|
| 63 |
prediction = get_prediction(question)
|
|
@@ -78,9 +79,9 @@ def majority_vote_with_steps(question, num_iterations=10):
|
|
| 78 |
|
| 79 |
expression = majority_voted_ans
|
| 80 |
if type_check(expression) == "Polynomial":
|
| 81 |
-
|
| 82 |
else:
|
| 83 |
-
|
| 84 |
|
| 85 |
# Find the steps corresponding to the majority voted answer
|
| 86 |
for i, ans in enumerate(all_answers):
|
|
@@ -92,7 +93,7 @@ def majority_vote_with_steps(question, num_iterations=10):
|
|
| 92 |
answer = majority_voted_ans
|
| 93 |
steps_solution = "No steps found"
|
| 94 |
|
| 95 |
-
return answer, steps_solution,
|
| 96 |
|
| 97 |
# Function to handle chat-like interaction and merge plot into chat history
|
| 98 |
def chat_interface(history, question):
|
|
|
|
| 58 |
all_predictions = []
|
| 59 |
all_answers = []
|
| 60 |
steps_list = []
|
| 61 |
+
plot_file=None
|
| 62 |
|
| 63 |
for _ in range(num_iterations):
|
| 64 |
prediction = get_prediction(question)
|
|
|
|
| 79 |
|
| 80 |
expression = majority_voted_ans
|
| 81 |
if type_check(expression) == "Polynomial":
|
| 82 |
+
plot_file = draw_polynomial_plot(expression)
|
| 83 |
else:
|
| 84 |
+
plot_file = "polynomial_plot.png"
|
| 85 |
|
| 86 |
# Find the steps corresponding to the majority voted answer
|
| 87 |
for i, ans in enumerate(all_answers):
|
|
|
|
| 93 |
answer = majority_voted_ans
|
| 94 |
steps_solution = "No steps found"
|
| 95 |
|
| 96 |
+
return answer, steps_solution, plot_file
|
| 97 |
|
| 98 |
# Function to handle chat-like interaction and merge plot into chat history
|
| 99 |
def chat_interface(history, question):
|