Skip to content

Commit

Permalink
feat: complete_code
Browse files Browse the repository at this point in the history
  • Loading branch information
Co1lin committed Nov 13, 2024
1 parent a189eb9 commit 83bf60e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions cweval/evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
COMPILE_DIR,
LANGS_COMPILE,
compile_list,
complete_code,
get_code_from,
pass_at_k,
run_in_subprocess,
Expand Down Expand Up @@ -103,10 +104,7 @@ def _parse_raw_file(self, raw_file_path: str) -> str:
tot_code = f'{raw_code}\n\n{entrypoint_src_line}\n{entrypoint_code}\n'

lang = os.path.splitext(raw_file_path)[1][1:]
if lang == 'c':
tot_code = f'''#include <stdio.h>
#include <stdbool.h>
{tot_code}'''
tot_code = complete_code(tot_code, lang)

return tot_code

Expand Down

0 comments on commit 83bf60e

Please sign in to comment.