Commit 99bd77f6 by nanziyuan

step1 sort_split_dataset fix bugs

parent 2ab59c74
...@@ -49,7 +49,7 @@ def sort_and_split_dataset(raw_dataset_path, new_train_path, new_test_path, mini ...@@ -49,7 +49,7 @@ def sort_and_split_dataset(raw_dataset_path, new_train_path, new_test_path, mini
assert len(new_test) % n == 0 assert len(new_test) % n == 0
for i in range(len(new_test) // n): for i in range(len(new_test) // n):
problem = new_test[i * n : (i + 1) * n] problem = new_test[i * n : (i + 1) * n]
has_correct_solution = all(d["eval_result"] for d in problem) has_correct_solution = any(d["eval_result"] for d in problem)
if has_correct_solution: if has_correct_solution:
minimal_test.extend(problem) minimal_test.extend(problem)
...@@ -59,11 +59,11 @@ def sort_and_split_dataset(raw_dataset_path, new_train_path, new_test_path, mini ...@@ -59,11 +59,11 @@ def sort_and_split_dataset(raw_dataset_path, new_train_path, new_test_path, mini
if __name__ == "__main__": if __name__ == "__main__":
cfg = read_config cfg = read_config()
sort_and_split_dataset( sort_and_split_dataset(
cfg["evaluate"]["evaluate_result_path"], cfg["evaluate"]["evaluate_result_path"],
cfg["dataset"]["train_path"], cfg["dataset"]["train_path"],
cfg["dataset"]["test_path"], cfg["dataset"]["test_path"],
cfg["dataset"]["minimal_test_path"], cfg["dataset"]["minimal_test_path"],
cfg["sample"]["sampling_params"]["n"] cfg["sample"]["sampling_params"]["n"]
) )
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment