File size: 783 Bytes
b48a35b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from huggingface_hub import HfApi

# Your repository name on Hugging Face
repo_id = "cranky-coder08/Phi2-Fine-Tuning"

# The local folder to upload (the current directory, represented by ".")
local_folder_path = "."

# Your Hugging Face access token with "write" permissions
# Replace with your actual token or leave it blank if you are already logged in
# token = "hf_..." 

# Initialize the Hugging Face API client
api = HfApi()

# Upload the entire folder
print(f"Uploading folder '{local_folder_path}' to '{repo_id}'...")
api.upload_large_folder(
    folder_path=local_folder_path,
    repo_id=repo_id,
    repo_type="model",
    # Optional: Set a commit message
    #commit_message="Initial upload of fine-tuned Phi2 model."
)

print("Upload complete!")