File size: 688 Bytes
ca4eb5b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import os
from huggingface_hub import HfApi

# Initialize the Hugging Face API client
api = HfApi(token=os.getenv("HF_TOKEN"))

# Create the repository if it doesn't exist
try:
    api.create_repo(repo_id="JoydeepC/trueGL", repo_type="model", private=False)
    print("Repository created successfully!")
except Exception as e:
    print(f"Repository already exists or error: {e}")

# Upload the model folder to the Hugging Face Hub
api.upload_folder(
    folder_path="E:\model_us",
    repo_id="JoydeepC/trueGL",
    repo_type="model",
    commit_message="Upload fine-tuned trueGL model",
    create_pr=False
)
print("Model uploaded successfully to JoydeepC/trueGL!")