File size: 682 Bytes
1109e5f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
26
27
28
29
30
31
32
#!/usr/bin/env python

import os
import fnmatch

import json
from huggingface_hub import HfApi


def find_json_files(directory):
    matches = []
    for root, dirnames, filenames in os.walk(directory):
        for filename in fnmatch.filter(filenames, '*.json'):
            matches.append(os.path.join(root, filename))
    return matches


directory_path = '/Users/pasquale/workspace/eval/requests'
json_files = find_json_files(directory_path)

api = HfApi()
model_lst = api.list_models()

model_lst = [m for m in model_lst]

id_to_model = {m.id: m for m in model_lst}

for path in json_files:
    with open(path, 'r') as file:
        data = json.load(file)
        breakpoint()