-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain.py
32 lines (22 loc) · 998 Bytes
/
main.py
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
import argparse
from openllm import *
def main():
parser = argparse.ArgumentParser(description="Scrape and export data from the Hugging Face leaderboard")
parser.add_argument("-csv", action="store_true", help="Export data to CSV")
parser.add_argument("-html", action="store_true", help="Export data to HTML")
parser.add_argument("-json", action="store_true", help="Export data to JSON")
args = parser.parse_args()
df = get_datas()
if not args.csv and not args.html and not args.json:
args.csv = True # If no arguments are provided, default to CSV export
if args.csv:
df.to_csv("open-llm-leaderboard.csv", index=False)
print("Data exported to CSV")
if args.html:
df.to_html("open-llm-leaderboard.html", index=False)
print("Data exported to HTML")
if args.json:
df.to_json("open-llm-leaderboard.json", orient='records')
print("Data exported to JSON")
if __name__ == "__main__":
main()