-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupload.py
More file actions
20 lines (20 loc) · 704 Bytes
/
upload.py
File metadata and controls
20 lines (20 loc) · 704 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from huggingface_hub import HfApi
import os
api = HfApi()
path = "/workspace/disk/models"
directory = sorted(os.listdir(path))
for folder in directory:
if folder in ["latest", "make-a-stable-diffusion-video-timelapse", "tmp", "v8-19_lr3.3333333333333335e-05"]:
continue
new_path = os.path.join(path, folder)
files = sorted(os.listdir(new_path))
for file in files:
final_path = os.path.join(new_path, file)
print("Uploading:", final_path)
api.upload_file(
path_or_fileobj=final_path,
path_in_repo=f"{folder}/{file}",
repo_id="chavinlo/TempoFunk",
repo_type="model",
revision="starry_pop"
)