| from dotenv import load_dotenv | |
| from huggingface_hub import HfApi | |
| import os | |
| load_dotenv() | |
| token = os.getenv("HF_TOKEN") | |
| if token is None: | |
| raise RuntimeError("HF_TOKEN not found. Check your .env file.") | |
| repo_id = "anilegin/lightweight-diffusion-vae" | |
| api = HfApi(token=token) | |
| api.upload_file( | |
| path_or_fileobj="/leonardo_scratch/large/userexternal/aegin000/models/vae/best.pt", | |
| path_in_repo="best.pt", | |
| repo_id=repo_id, | |
| repo_type="model", | |
| token=token, | |
| commit_message="Replace best.pt with inference-only VAE weights", | |
| ) | |
| print("Uploaded clean best.pt to Hugging Face.") | |