Add eval_mm dir

This commit is contained in:
trainfanlhy
2024-05-28 01:21:34 +08:00
parent 7e12387362
commit 65f5567a3a
49 changed files with 5610 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
import argparse
import json
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("--input_file_path", type=str, default="", help="path to the originial output json.")
parser.add_argument("--output_file_path", type=str, default="", help="path to where you want to save the processed json.")
args = parser.parse_args()
with open(args.input_file_path , 'r') as f:
data = json.load(f)
transformed_data = [{"questionId": item["question_id"], "answer": item["answer"].replace("</s>", "")} for item in data]
with open(args.output_file_path, 'w') as f:
json.dump(transformed_data, f)