File size: 651 Bytes
3ed6477
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
005d6f3
3ed6477
 
 
 
 
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
import argparse
import os
from huggingface_hub import HfApi

TOKEN = os.environ.get("DEBUG")
api = HfApi(token=TOKEN)

parser = argparse.ArgumentParser()
parser.add_argument(
    "--run_dir",
    default="./runs",
    type=str,
    required=False,
    help="Path to the runs directory.",
)
args = parser.parse_args()

print("Attempting to save the Space runs directory, %s" % args.run_dir)
try:
    api.upload_folder(
        folder_path=args.run_dir,
        path_in_repo=args.run_dir,
        repo_id="AIEnergyScore/backend_runs_directory",
        repo_type="dataset",
    )
except Exception as e:
    print("That didn't work. Error:")
    print(e)