hugo flores garcia commited on
Commit
11876c0
·
1 Parent(s): 1c7ca11
.gitignore CHANGED
@@ -193,4 +193,7 @@ pyharp
193
  models/vampnet/*
194
  models/*
195
 
196
- lib/
 
 
 
 
193
  models/vampnet/*
194
  models/*
195
 
196
+ lib/
197
+
198
+ _outputs/
199
+ debug.txt
app.py CHANGED
@@ -198,9 +198,10 @@ def harp_vamp(input_audio_file, periodic_p, n_mask_codebooks):
198
  for p in OUT_DIR.glob("*"):
199
  p.unlink()
200
  OUT_DIR.mkdir(exist_ok=True)
201
- outpath = OUT_DIR / f"{uuid.uuid4()}.wav"
 
 
202
  sig.write(outpath)
203
- from pyharp import AudioLabel, LabelList
204
  output_labels = LabelList()
205
  output_labels.append(AudioLabel(label='~', t=0.0, amplitude=0.5, description='generated audio'))
206
  return outpath, output_labels
 
198
  for p in OUT_DIR.glob("*"):
199
  p.unlink()
200
  OUT_DIR.mkdir(exist_ok=True)
201
+ # outpath = OUT_DIR / f"{uuid.uuid4()}.wav"
202
+ from pyharp import AudioLabel, LabelList, save_audio
203
+ outpath = save_audio(sig)
204
  sig.write(outpath)
 
205
  output_labels = LabelList()
206
  output_labels.append(AudioLabel(label='~', t=0.0, amplitude=0.5, description='generated audio'))
207
  return outpath, output_labels
scripts/utils/huggingface/push_to_repos.sh ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # the (remote repo, model_name) are:
2
+ # vampnet-music (default)
3
+ # vampnet-percussion (percussion)
4
+ # vampnet-choir ()'choir')
5
+ # etc for..
6
+ # 'machines'
7
+ # 'n64'
8
+ # 'opera'
9
+ # 'percussion'
10
+
11
+ # iterate through remote, model_name pairs:
12
+ # and edit the DEFAULT_MODEL file in the repo
13
+ # add commit and push to the right remote
14
+ # each remote starts with https://huggingface.co/hugggof/{repo_name}
15
+
16
+ for repo in vampnet-music vampnet-percussion vampnet-choir vampnet-machines vampnet-n64 vampnet-opera vampnet-percussion
17
+ do
18
+ echo "repo: $repo"
19
+ # get the model name from the repo
20
+ model_name=$(echo $repo | cut -d'-' -f2)
21
+ # if the model_name is music , set it to default
22
+ if [ $model_name == "music" ]; then
23
+ model_name="default"
24
+ fi
25
+ echo "model_name: $model_name"
26
+ # remove the DEFAULT_MODEL file
27
+ rm DEFAULT_MODEL
28
+ # create a new DEFAULT_MODEL file with the model name
29
+ echo $model_name > DEFAULT_MODEL
30
+
31
+ # commit and push to the right remote
32
+ git add DEFAULT_MODEL
33
+ git commit -m "update DEFAULT_MODEL to $model_name"
34
+ git remote remove $repo
35
+ git remote add $repo https://huggingface.co/spaces/hugggof/$repo
36
+ git push $repo main
37
+ done