Auto-load HF_TOKEN from Kaggle Secrets
Browse files142 unmodified lines143144145146147148149150151142 unmodified linesparser.add_argument("--private", action="store_true", help="Make model private")args = parser.parse_args()export_and_push(checkpoint_path=args.checkpoint,repo_id=args.repo_id,token=args.token,private=args.private,)142 unmodified lines143144145146147148149150151152153154155156157158159142 unmodified linesparser.add_argument("--private", action="store_true", help="Make model private")args = parser.parse_args()token = args.token or os.environ.get("HF_TOKEN")if not token:try:from kaggle_secrets import UserSecretsClienttoken = UserSecretsClient().get_secret("HF_TOKEN")print("[+] Loaded HF_TOKEN from Kaggle Secrets.")except Exception:passexport_and_push(checkpoint_path=args.checkpoint,repo_id=args.repo_id,token=token,private=args.private,)
export_hf.py+9-1