open_pt_llm_leaderboard / update_models_in_readme.py
eduagarcia's picture
update README
4a005f5
from src.envs import (
API,
EVAL_REQUESTS_PATH,
DYNAMIC_INFO_REPO,
DYNAMIC_INFO_FILE_PATH,
DYNAMIC_INFO_PATH,
EVAL_RESULTS_PATH,
H4_TOKEN, IS_PUBLIC,
QUEUE_REPO,
REPO_ID,
RESULTS_REPO,
SHOW_INCOMPLETE_EVALS
)
from huggingface_hub import snapshot_download
import os
import glob
import json
snapshot_download(repo_id=QUEUE_REPO, local_dir=EVAL_REQUESTS_PATH, repo_type="dataset", tqdm_class=None, etag_timeout=30)
all_models = []
all_models.append('nvidia/Nemotron-4-340B-Instruct')
all_models.append('meta-llama/Meta-Llama-3.1-405B-Instruct')
for filepath in glob.glob(os.path.join(EVAL_REQUESTS_PATH, '**/*.json'), recursive=True):
with open(filepath, 'r') as f:
model_data = json.load(f)
if model_data['status'] == 'FINISHED':
all_models.append(model_data['model'])
all_models = sorted(list(set(all_models)))
with open('model_list.txt', 'w') as fw:
for m in all_models:
print(m)
fw.write(' - '+ m + '\n')