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

Function delete_error

eval_heldout/hotpotQA/src/utils.py:98–108  ·  view source on GitHub ↗
(file_name)

Source from the content-addressed store, hash-verified

96 return tasks
97
98def delete_error(file_name):
99 sessions = get_all_agent_sessions(file_name)
100 non_error_sessions = [sess for sess in sessions if not sess["error"]]
101 with open(file_name+'.back', 'a') as b_f:
102 for sess in sessions:
103 json.dump(sess, b_f)
104 b_f.write('\n')
105 with open(file_name, 'w') as f:
106 for sess in non_error_sessions:
107 json.dump(sess, f)
108 f.write('\n')
109
110def summarize_react_trial(agents):
111 correct = [a for a in agents if a.is_correct()]

Callers

nothing calls this directly

Calls 2

get_all_agent_sessionsFunction · 0.85
writeMethod · 0.45

Tested by

no test coverage detected