File size: 835 Bytes
b67af4a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
33
34
35
import os
import sys

sys.path.append(os.path.dirname(os.path.dirname(__file__)))

from scripts.hf_tools import HFReportGenerateTool


def main():
    tool = HFReportGenerateTool()
    # Minimal aggregated data example
    data = {
        "Models": [{
            "type": "model",
            "id": "bert-base-uncased",
            "owner": "google",
            "url": "https://huggingface.co/bert-base-uncased",
            "downloads": 100,
            "likes": 10,
            "updatedAt": "2024-01-01",
            "description": "BERT base cased model"
        }],
        "Datasets": [],
        "Spaces": []
    }
    import json
    html = tool.forward(data_json=json.dumps(data), title="Test Report")
    print(html[:500])  # print first 500 chars


if __name__ == "__main__":
    main()