MCPcopy Create free account
hub / github.com/codefuse-ai/codefuse-devops-eval / test_process

Function test_process

src/opensource_functioncall_evalution.py:179–193  ·  view source on GitHub ↗
(test_lines, gpu_index)

Source from the content-addressed store, hash-verified

177
178
179def test_process(test_lines, gpu_index):
180 global test_result_lines
181 for line in tqdm(test_lines, desc="Process%02d"%(gpu_index)):
182 chat_dict = json.loads(line)
183 test_dict = {}
184 test_dict["functions"] = chat_dict["functions"]
185 test_dict["chatrounds"] = []
186 for chatround in chat_dict["chatrounds"]:
187 if chatround["role"] == "assistant":
188 ass_predict = get_assistant_ans.gen_answer(test_dict, gpu_index=gpu_index)
189 save_dict = copy.deepcopy(test_dict)
190 save_dict["chatrounds"].append(ass_predict)
191 test_result_lines.append(json.dumps(save_dict, ensure_ascii=False))
192 calc_llm_index(ass_predict, chatround, test_dict)
193 test_dict["chatrounds"].append(chatround)
194
195
196def main():

Callers

nothing calls this directly

Calls 2

calc_llm_indexFunction · 0.85
gen_answerMethod · 0.45

Tested by

no test coverage detected