MCPcopy Create free account
hub / github.com/THUDM/AgentTuning / get_score

Function get_score

AgentBench.old/src/tasks/mind2web/dataloader.py:262–272  ·  view source on GitHub ↗
(sample)

Source from the content-addressed store, hash-verified

260 candidate_ranks = candidate_results["ranks"]
261
262 def get_score(sample):
263 sample_id = f"{sample['annotation_id']}_{sample['action_uid']}"
264 for candidates in [sample["pos_candidates"], sample["neg_candidates"]]:
265 for candidate in candidates:
266 candidate_id = candidate["backend_node_id"]
267 candidate["score"] = candidate_scores[sample_id][candidate_id]
268 candidate["rank"] = candidate_ranks[sample_id][candidate_id]
269 return {
270 "pos_candidates": sample["pos_candidates"],
271 "neg_candidates": sample["neg_candidates"],
272 }
273
274 flatten_dataset = flatten_dataset.map(get_score)
275 if is_train:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected