Calculate evaluation metrics
mainOnce generation is complete, use scripts/eval.py to calculate the final metrics. Use the --only_compute_metric flag to skip other processes and focus on metric calculation.
Required arguments:
--prompt_file: Path to the.jsonlprompt file.--output_dir: Directory containing the generated outputs.--ts_lib: Path to the compiled language parser (e.g.,./build/python-lang-parser.so).--language: The programming language.--only_compute_metric: Flag to trigger metric calculation.
export language=python
export ts_lib=./build/${language}-lang-parser.so;
export task=line_completion_oracle_unixcoder_cosine_sim
export prompt_file=./data/${language}/${task}.jsonl
export output_dir=./tmp/crosscodeeval_testrun/;
python scripts/eval.py \
--prompt_file $prompt_file \
--output_dir $output_dir \
--ts_lib $ts_lib \
--language $language \
--only_compute_metric