File size: 813 Bytes
dea6c7a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import json

def main(prmopts_path_1, prompts_path_2):
    prompts_1 = json.load(open(prmopts_path_1, "r"))
    prompts_2 = json.load(open(prompts_path_2, "r"))
    
    new_prompts = {}
    new_idx = 0
    for prompt_key in prompts_1:
        prompt_key_lst = prompt_key.split("_")
        prompt_key_lst[0] = str(new_idx)
        new_prompts['_'.join(prompt_key_lst)] = prompts_1[prompt_key]
        new_idx += 1
    
    for prompt_key in prompts_2:
        prompt_key_lst = prompt_key.split("_")
        prompt_key_lst[0] = str(new_idx)
        new_prompts['_'.join(prompt_key_lst)] = prompts_2[prompt_key]
        new_idx += 1
    
    with open(f"t2v_vbench_1000.json", "w") as f:
        json.dump(new_prompts, f, indent=4)

if __name__ == "__main__":
    main("t2v_vbench_200.json", "t2v_vbench_800.json")