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)