MCPcopy Create free account
hub / github.com/OpenBMB/ToolBench / get_most_preferred

Function get_most_preferred

toolbench/tooleval/automatic_eval_sample.py:88–96  ·  view source on GitHub ↗
(d:list)

Source from the content-addressed store, hash-verified

86 [ref_ans,ans])
87 return qid,ret
88 def get_most_preferred(d:list)->np.ndarray:
89 if np.iterable(d):
90 d = np.asanyarray(d)
91 bins = np.bincount(d)
92 max_val = np.max(bins)
93 argmax = np.where(max_val==bins)[0]
94 return argmax
95 else:
96 return np.asarray([d])
97
98 print('Evaluating...')
99 prefer_dict = {}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected