Skip to main content
Upload a trained LoRA or aLoRA adapter to Hugging Face Hub. Creates the target repository if it does not already exist and pushes the entire adapter weights directory (output of save_pretrained) to the repository root. Requires an authenticated Hugging Face token set via the HF_TOKEN environment variable or huggingface-cli login.

Functions

FUNC upload_model

upload_model(weight_path: str, model_name: str, private: bool = True)
Upload a trained adapter (LoRA/aLoRA) to Hugging Face Hub. Args:
  • weight_path: Directory containing adapter weights (from save_pretrained).
  • model_name: Target model repo name (e.g., “acme/carbchecker-alora”).
  • private: Whether the repo should be private. Default: True.
Raises:
  • FileNotFoundError: If weight_path does not exist on disk.
  • OSError: If no Hugging Face authentication token is found.
  • RuntimeError: If creating or accessing the Hugging Face repository fails.