MCPcopy Create free account
hub / github.com/OpenBitSys/BitDistiller / maj

Function maj

test/gsm8k/eval.py:156–166  ·  view source on GitHub ↗
(lst)

Source from the content-addressed store, hash-verified

154 return
155
156 def maj(lst):
157 lst = [x for x in lst if x != INVALID_ANS]
158 if not lst:
159 return INVALID_ANS
160 # Count the occurrences of each string in the list
161 counts = Counter(lst)
162
163 # Find the string with the highest count
164 most_common = max(counts, key=counts.get)
165
166 return most_common
167
168 pred_ans_multiple = [parse(prediction) for prediction in lines]
169 pred_ans = [maj([prediction[i] for prediction in pred_ans_multiple]) for i in range(len(pred_ans_multiple[0]))]

Callers 1

eval_majority_votingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected