File size: 1,050 Bytes
c330d97
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
from huggingface_hub import HfApi, list_repo_files

import os
TOKEN = os.environ.get("HF_TOKEN", "")
api = HfApi(token=TOKEN)

repos = sorted(api.list_models(author="Shanmuk4622"), key=lambda x: x.id)
print(f"Total repos on HF: {len(repos)}\n")

missing_readme  = []
missing_weights = []

for r in repos:
    files       = list(list_repo_files(r.id, token=TOKEN))
    has_readme  = "README.md" in files
    has_weights = any(f.endswith(".pth") for f in files)
    has_csv     = any(f.endswith(".csv") for f in files)
    parts = []
    if has_readme:  parts.append("README")
    if has_weights: parts.append("weights")
    if has_csv:     parts.append("CSV")
    tag    = "OK" if (has_readme and has_weights) else "!!"
    name   = r.id.replace("Shanmuk4622/", "")
    print(f"  [{tag}]  {name:<45}  [{' + '.join(parts)}]")
    if not has_readme:  missing_readme.append(name)
    if not has_weights: missing_weights.append(name)

print()
print(f"Missing README  : {missing_readme  or 'None'}")
print(f"Missing weights : {missing_weights or 'None'}")