(test_lines, gpu_index)
| 177 | |
| 178 | |
| 179 | def 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 | |
| 196 | def main(): |
nothing calls this directly
no test coverage detected