|
import pdb |
|
import subprocess |
|
import re |
|
|
|
|
|
output_file = "pass_rate_output.txt" |
|
|
|
|
|
with open(output_file, "w") as file: |
|
file.write("") |
|
|
|
|
|
input_path_lists = [ |
|
"test/zero_shot/wild_test/generation/lean4_random_15k_all/2/1/", |
|
] |
|
|
|
def get_output(input_string): |
|
pattern = r"zero_shot/(\w+)/(.+?)/(\w+)" |
|
match = re.search(pattern, input_string) |
|
if match: |
|
part1 = match.group(1) |
|
part2 = match.group(3) + ".jsonl" |
|
result = "/".join([part1, part2]) |
|
print(result) |
|
else: |
|
print("No match found.") |
|
assert True |
|
return result |
|
|
|
|
|
input_path_lists = [ |
|
"/opt/tiger/auto-info/generate_result/zero_shot/lean4_basic_test/generation/lean4_random_5k/2/1/", |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
] |
|
|
|
|
|
for input_path in input_path_lists: |
|
print(f"Running for input path: {input_path}", file=open(output_file, "a")) |
|
command = f"python3 pass_rate_new.py --input_path {input_path} --output_path {get_output(input_path)}" |
|
subprocess.run(command, shell=True, stdout=open(output_file, "a"), stderr=subprocess.STDOUT) |
|
print("\n\n",file=open(output_file, "a")) |
|
|
|
|