from huggingface_hub import HfApi # Assuming you saved your model locally during training model_path = "./" repo_id = "loisonchambers/lunar2" # 1. Initialize API api = HfApi() # 2. Create the repo (if it doesn't exist) api.create_repo(repo_id=repo_id, exist_ok=True) # 3. Upload your folder api.upload_folder(folder_path=model_path, repo_id=repo_id, repo_type="model") print(f"Model successfully uploaded to: https://huggingface.co/{repo_id}")