File size: 1,189 Bytes
11876c0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
30
31
32
33
34
35
36
37
# the (remote repo, model_name) are:
#  vampnet-music (default)
#  vampnet-percussion (percussion)
#  vampnet-choir ()'choir')
#  etc for..
# 'machines'
# 'n64'
#  'opera'
#   'percussion'

# iterate through remote, model_name pairs:
# and edit the DEFAULT_MODEL file in the repo
# add commit and push to the right remote
# each remote starts with https://huggingface.co/hugggof/{repo_name}

for repo in vampnet-music vampnet-percussion vampnet-choir vampnet-machines vampnet-n64 vampnet-opera vampnet-percussion
do
    echo "repo: $repo"
    # get the model name from the repo
    model_name=$(echo $repo | cut -d'-' -f2)
    # if the model_name is music , set it to default
    if [ $model_name == "music" ]; then
        model_name="default"
    fi
    echo "model_name: $model_name"
    # remove the DEFAULT_MODEL file
    rm DEFAULT_MODEL
    # create a new DEFAULT_MODEL file with the model name
    echo $model_name > DEFAULT_MODEL

    # commit and push to the right remote
    git add DEFAULT_MODEL
    git commit -m "update DEFAULT_MODEL to $model_name"
    git remote remove $repo
    git remote add $repo https://huggingface.co/spaces/hugggof/$repo
    git push $repo main
done