get_ipython().getoutput("pip install -q huggingface_hub") from huggingface_hub import login from kaggle_secrets import UserSecretsClient # "HF_TOKEN" here is the LABEL you set in Add-ons -> Secrets, not the token itself hf_token = UserSecretsClient().get_secret("HF_TOKEN") login(token=hf_token) get_ipython().getoutput("kaggle kernels output mickey2004/complete-fakeddit-image -p "/kaggle/working/"") from huggingface_hub import HfApi, create_repo repo_id = "jayesh20/ai-image-detector" # change this api = HfApi() # Create the repo (safe to call even if it already exists) create_repo(repo_id, repo_type="model", exist_ok=True, private=False) # Upload a single checkpoint file api.upload_file( path_or_fileobj="/kaggle/working/best_clip_detector.pth", path_in_repo="best_clip_detector.pth", repo_id=repo_id, repo_type="model", ) api.upload_folder( folder_path="/kaggle/working/", repo_id=repo_id, repo_type="model", path_in_repo=".", # or "stage1/" to keep it in a subfolder )