Pra-tham commited on
Commit
f9026c5
·
1 Parent(s): 35deaeb
Files changed (1) hide show
  1. app.py +10 -3
app.py CHANGED
@@ -2,8 +2,8 @@ import gradio as gr
2
  import ctranslate2
3
  from transformers import AutoTokenizer
4
  from huggingface_hub import snapshot_download
5
- from codeexecutor import get_majority_vote,type_check
6
- import codeexecutor
7
 
8
  import re
9
  import os
@@ -60,14 +60,21 @@ def majority_vote_with_steps(question, num_iterations=10):
60
  all_predictions.append(prediction)
61
  all_answers.append(answer)
62
  steps_list.append(steps)
 
63
  else:
64
  answer, steps = parse_prediction(prediction)
65
  all_predictions.append(prediction)
66
  all_answers.append(answer)
67
  steps_list.append(steps)
 
 
 
 
 
68
 
69
  # Get the majority voted answer
70
- majority_voted_ans = get_majority_vote(all_answers)
 
71
 
72
  # Find the steps corresponding to the majority voted answer
73
  for i, ans in enumerate(all_answers):
 
2
  import ctranslate2
3
  from transformers import AutoTokenizer
4
  from huggingface_hub import snapshot_download
5
+ from codeexecutor import get_majority_vote,type_check,postprocess_completion
6
+
7
 
8
  import re
9
  import os
 
60
  all_predictions.append(prediction)
61
  all_answers.append(answer)
62
  steps_list.append(steps)
63
+ majority_voted_ans = get_majority_vote(all_answers)
64
  else:
65
  answer, steps = parse_prediction(prediction)
66
  all_predictions.append(prediction)
67
  all_answers.append(answer)
68
  steps_list.append(steps)
69
+ majority_voted_ans = get_majority_vote(all_answers)
70
+ if type_check(majority_voted_ans)=="Polynomial":
71
+ pass
72
+ #draw plot of polynomial
73
+
74
 
75
  # Get the majority voted answer
76
+
77
+
78
 
79
  # Find the steps corresponding to the majority voted answer
80
  for i, ans in enumerate(all_answers):