mirror of
https://github.com/OpenBMB/MiniCPM-V.git
synced 2026-02-05 18:29:18 +08:00
Add eval_mm dir
This commit is contained in:
16
eval_mm/vqaeval/transform_docvqatest_for_submission.py
Normal file
16
eval_mm/vqaeval/transform_docvqatest_for_submission.py
Normal 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)
|
||||
Reference in New Issue
Block a user