File size: 449 Bytes
12d0891
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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}")