From 62887ad1fcfa9eb393b77a1bae79b84cc910b2d6 Mon Sep 17 00:00:00 2001 From: joesharratt1229 <118444587+joesharratt1229@users.noreply.github.com> Date: Mon, 28 Jul 2025 15:56:16 +0100 Subject: [PATCH] Update load_fsdp_to_hf.py --- training/utils/load_fsdp_to_hf.py | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/training/utils/load_fsdp_to_hf.py b/training/utils/load_fsdp_to_hf.py index 809c30ad..e9b13b00 100644 --- a/training/utils/load_fsdp_to_hf.py +++ b/training/utils/load_fsdp_to_hf.py @@ -32,27 +32,6 @@ def main(fsdp_checkpoint_path, huggingface_model_path, output_path, push_to_hub= tokenizer = AutoTokenizer.from_pretrained(huggingface_model_path) tokenizer.save_pretrained(output_path) - # Push to hub if requested - if push_to_hub: - if not output_path: - raise ValueError("output path must be provided when push_to_hub=True") - - print(f"Pushing model to Hugging Face Hub: {output_path}") - - # Create repository if it doesn't exist - api = HfApi(token=hub_token) - try: - create_repo(repo_id=output_path, private=private, exist_ok=True, token=hub_token) - print(f"Repository {output_path} created or already exists") - except Exception as e: - print(f"Repository creation info: {e}") - - # Push model and tokenizer to hub - model.push_to_hub(output_path, token=hub_token, private=private) - tokenizer.push_to_hub(output_path, token=hub_token, private=private) - - print(f"✅ Model successfully pushed to https://huggingface.co/{output_path}") - if __name__ == "__main__": fire.Fire(main)