support for rust

This commit is contained in:
sherwin6180 2025-06-25 20:37:10 -04:00
parent b7ba565956
commit 7240b22b56
6 changed files with 177 additions and 6 deletions

File diff suppressed because one or more lines are too long

6
Evaluation/HumanEval/eval.sh Normal file → Executable file
View File

@ -1,4 +1,4 @@
MODEL_NAME_OR_PATH="deepseek/deepseek-coder-1b"
MODEL_NAME_OR_PATH="/scratch/shared_dir/xinyu/deepseek-1.3b"
DATASET_ROOT="data/"
LANGUAGE="python"
CUDA_VISIBLE_DEVICES=1,2,3 python -m accelerate.commands.launch --config_file test_config.yaml eval_pal.py --logdir ${MODEL_NAME_OR_PATH} --language ${LANGUAGE} --dataroot ${DATASET_ROOT}
LANGUAGE="rust"
CUDA_VISIBLE_DEVICES=1,2,3 python -m accelerate.commands.launch --config_file test_config.yaml eval_pal.py --logdir ${MODEL_NAME_OR_PATH} --language ${LANGUAGE} --dataroot ${DATASET_ROOT}

View File

@ -167,9 +167,9 @@ def process_humaneval_test(sample, problems, example_test=False, is_mbpp=False,
else:
test_string = test_setup + "\n" + prompt + code + "\n" + test
elif language == "rust":
main = "\nfn main(){ \n } \n"
declaration = problems[task_id]["declaration"]
test_string = main + declaration + prompt + code + test
# main = "\nfn main(){ \n } \n"
# declaration = problems[task_id]["declaration"]
test_string = code + test
elif language == "php":
if code[:5] != "<?php":
code = "<?php\n" + code

View File

@ -0,0 +1,8 @@
[package]
name = "rust"
version = "0.1.0"
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]

View File

@ -0,0 +1,7 @@
#[cfg(test)]
mod tests {
#[test]
fn it_works() {
assert_eq!(2 + 2, 4);
}
}