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

Function get_preference

toolbench/tooleval/automatic_eval_sample.py:80–87  ·  view source on GitHub ↗
(qid,query,tools,ref_ans,ans,)

Source from the content-addressed store, hash-verified

78 evaluators = [load_registered_automatic_evaluator(vars(args)) for _ in range(args.max_eval_threads)]
79
80 def get_preference(qid,query,tools,ref_ans,ans,):
81 global evaluators
82 evaluator = random.choice(evaluators)
83 ret = evaluator.annotate_preference(
84 query,
85 tools,
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)

Callers

nothing calls this directly

Calls 1

annotate_preferenceMethod · 0.80

Tested by

no test coverage detected