|
import os |
|
import json |
|
import shutil |
|
|
|
data_path = './data/' |
|
no_generated_image_path = './no_generated_image.png' |
|
|
|
expected_files = [ |
|
'hf_llm_diagramv2.json', |
|
'hf_llm_diagramv2.png', |
|
'hf_llm_diagramv2_other_permissive.json', |
|
'hf_llm_diagramv2_other_permissive.png', |
|
'hf_llm_diagramv2_permissive.json', |
|
'hf_llm_diagramv2_permissive.png', |
|
'hf_llm_diagramv2_rescore.json', |
|
'hf_llm_diagramv2_rescore.png', |
|
'hg_average_to_agentbench_compare.png', |
|
'hg_average_to_alpacaeval_compare.png', |
|
'hg_average_to_mosaic_compare.png', |
|
'hg_average_to_mt_bench_compare.png', |
|
'hg_average_to_opencompass_compare.png' |
|
] |
|
|
|
|
|
for dir_name in os.listdir(data_path): |
|
if os.path.isdir(os.path.join(data_path, dir_name)): |
|
for expected_file in expected_files: |
|
file_path = os.path.join(data_path, dir_name, expected_file) |
|
|
|
|
|
if not os.path.exists(file_path): |
|
|
|
if expected_file.endswith('.png'): |
|
shutil.copy(no_generated_image_path, file_path) |
|
|
|
elif expected_file.endswith('.json'): |
|
with open(file_path, 'w') as f: |
|
json.dump([], f) |
|
|
|
print("Process completed!") |