File size: 1,071 Bytes
5755408
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
"""Upload ToolFault-Bench to the Hugging Face Hub.

    pip install -U huggingface_hub
    hf auth login            # older versions: huggingface-cli login  (needs a token with write access)
    python push.py           # public dataset at ATTY57/toolfault-bench
    python push.py --private # upload privately first to review the page
"""
import argparse
import os

from huggingface_hub import HfApi

ap = argparse.ArgumentParser()
ap.add_argument("--repo", default="ATTY57/toolfault-bench")
ap.add_argument("--private", action="store_true")
a = ap.parse_args()

here = os.path.dirname(os.path.abspath(__file__))
api = HfApi()
api.create_repo(a.repo, repo_type="dataset", private=a.private, exist_ok=True)
api.upload_folder(
    folder_path=here,
    repo_id=a.repo,
    repo_type="dataset",
    allow_patterns=["README.md", "LICENSE-CODE", "requirements.txt", "evaluate.py", "push.py",
                    "data/*.parquet", "scripts/*.py", "results/*/metrics.json"],
    commit_message="ToolFault-Bench v1.0",
)
print(f"Done: https://huggingface.co/datasets/{a.repo}")