File size: 946 Bytes
d2311b4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
27
28
29
import os
from tqdm import tqdm
from huggingface_hub import upload_file

# --- ์„ค์ • ---
repo_id = "Syzseisus/24W_GLM_pretrained"
base_folder = "."  # ์—…๋กœ๋“œํ•  ๋กœ์ปฌ ํด๋”
repo_type = "model"            # ๋ชจ๋ธ ๋ ˆํฌ์ง€ํ† ๋ฆฌ

# --- ํด๋” ์žฌ๊ท€ ํƒ์ƒ‰ ---
for root, dirs, files in tqdm(os.walk(base_folder), desc="mother"):
    for file in tqdm(files, desc="children", leave=False):
        local_path = os.path.join(root, file)
        # repo ๋‚ด ๊ฒฝ๋กœ: base_folder ์ดํ›„ ๊ฒฝ๋กœ๋งŒ ์‚ฌ์šฉ
        repo_path = os.path.relpath(local_path, base_folder)
        
        print(f"Uploading {local_path} -> {repo_path} ...")
        
        try:
            upload_file(
                path_or_fileobj=local_path,
                path_in_repo=repo_path,
                repo_id=repo_id,
                repo_type=repo_type
            )
            print("โœ… Done")
        except Exception as e:
            print(f"โŒ Failed: {e}")