Spaces:
Runtime error
Runtime error
#!/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() | |