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

Function main

light-eval/src/eval_humaneval.py:168–192  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

166 writer.write(x)
167
168def main(args):
169
170 path_split = args.pretrained_path.split('/')
171 if path_split[-1] == '':
172 path_split.pop(-1)
173 model_name = path_split[-1]
174 infer_path = os.path.join('results', model_name, 'humaneval/infer')
175 os.makedirs(infer_path, exist_ok=True)
176 eval_path = os.path.join('results', model_name, 'humaneval/eval')
177 os.makedirs(eval_path, exist_ok=True)
178
179 model = load(args)
180
181 infer_file = os.path.join(infer_path, 'human_infer.jsonl')
182 run_infer(model, infer_file, args.overwrite,)
183
184 torch.distributed.barrier()
185 if torch.distributed.get_rank() == 0:
186
187 print("Evaluating...")
188 score = entry_point(sample_file=infer_file)
189
190 with open(os.path.join(eval_path, 'run_results.json'), 'w') as f:
191 json.dump(score, f, ensure_ascii=False, indent=2)
192 print(score)
193
194
195if __name__ == "__main__":

Callers 1

eval_humaneval.pyFile · 0.70

Calls 4

printFunction · 0.85
entry_pointFunction · 0.85
loadFunction · 0.70
run_inferFunction · 0.70

Tested by

no test coverage detected