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}")
|