MCPcopy Create free account
hub / github.com/Alpha-VLLM/LLaMA2-Accessory / main

Function main

light-eval/src/eval_ceval.py:212–235  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

210 return results
211
212def main(args):
213
214 path_split = args.pretrained_path.split('/')
215 if path_split[-1] == '':
216 path_split.pop(-1)
217 model_name = path_split[-1]
218 eval_path = os.path.join('results', model_name, 'ceval/eval')
219 os.makedirs(eval_path, exist_ok=True)
220
221 model = load(args)
222
223 result_path = os.path.join(eval_path, 'run_results.json')
224 if not args.overwrite and os.path.exists(result_path):
225 print(f"{result_path} existed, skip!")
226 return
227
228 subjects_result = run_infer_eval(model, args.max_seq_len, args.data_dir, args.ntrain)
229
230 torch.distributed.barrier()
231 if torch.distributed.get_rank() == 0:
232
233 score = cal_ceval(subjects_result)
234 with open(result_path, 'w') as f:
235 json.dump(score, f, ensure_ascii=False, indent=2)
236
237if __name__ == "__main__":
238

Callers 1

eval_ceval.pyFile · 0.70

Calls 4

printFunction · 0.85
cal_cevalFunction · 0.85
loadFunction · 0.70
run_infer_evalFunction · 0.70

Tested by

no test coverage detected