File size: 608 Bytes
41b9d24
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from pathlib import Path

run_dir = Path("runs/sample-instrument")
name = run_dir.name

repo_dir = Path("models/vampnet")


for part in ("coarse", "c2f"):
    outdir = repo_dir / "loras" / name 
    outdir.mkdir(parents=True, exist_ok=True)
    outpath = outdir / f"{part}.pth"
    path = run_dir / part / "latest" / "vampnet" / "weights.pth"
    path.rename(outpath)
    print(f"moved {path} to {outpath}")

# now, push to hub
from huggingface_hub import Repository
repo = Repository(repo_dir, git_user="hugofloresgarcia", git_email="[email protected]")
repo.push_to_hub(
    commit_message=f"add {name}"
)