Spaces:
Running
Running
Hugo Flores Garcia
commited on
Commit
·
423d60f
1
Parent(s):
9d98314
add harp endpoint
Browse files
app.py
CHANGED
@@ -10,6 +10,7 @@ import argbind
|
|
10 |
import shutil
|
11 |
import torch
|
12 |
from datetime import datetime
|
|
|
13 |
|
14 |
import gradio as gr
|
15 |
from vampnet.interface import Interface, signal_concat
|
@@ -341,7 +342,7 @@ def api_vamp(input_audio,
|
|
341 |
)
|
342 |
|
343 |
def harp_vamp(input_audio, sampletemp, periodic_p, dropout, n_mask_codebooks, model_choice, beat_mask_ms):
|
344 |
-
|
345 |
seed=0,
|
346 |
input_audio=input_audio,
|
347 |
model_choice=model_choice,
|
@@ -361,6 +362,13 @@ def harp_vamp(input_audio, sampletemp, periodic_p, dropout, n_mask_codebooks, mo
|
|
361 |
beat_mask_ms=beat_mask_ms,
|
362 |
num_feedback_steps=1
|
363 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
364 |
|
365 |
|
366 |
with gr.Blocks() as demo:
|
@@ -694,6 +702,21 @@ with gr.Blocks() as demo:
|
|
694 |
)
|
695 |
|
696 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
697 |
try:
|
698 |
demo.queue()
|
699 |
demo.launch(share=True)
|
|
|
10 |
import shutil
|
11 |
import torch
|
12 |
from datetime import datetime
|
13 |
+
from pyharp import load_audio, save_audio, OutputLabel, LabelList, build_endpoint, ModelCard
|
14 |
|
15 |
import gradio as gr
|
16 |
from vampnet.interface import Interface, signal_concat
|
|
|
342 |
)
|
343 |
|
344 |
def harp_vamp(input_audio, sampletemp, periodic_p, dropout, n_mask_codebooks, model_choice, beat_mask_ms):
|
345 |
+
out = _vamp_internal(
|
346 |
seed=0,
|
347 |
input_audio=input_audio,
|
348 |
model_choice=model_choice,
|
|
|
362 |
beat_mask_ms=beat_mask_ms,
|
363 |
num_feedback_steps=1
|
364 |
)
|
365 |
+
sr, output_audio = out
|
366 |
+
# save the output audio
|
367 |
+
sig = at.AudioSignal(output_audio, sr).to_mono()
|
368 |
+
|
369 |
+
ll = LabelList()
|
370 |
+
ll.append(OutputLabel(label='short label', t=0.0, description='longer description'))
|
371 |
+
return save_audio(sig), ll
|
372 |
|
373 |
|
374 |
with gr.Blocks() as demo:
|
|
|
702 |
)
|
703 |
|
704 |
|
705 |
+
app = build_endpoint(
|
706 |
+
model_card=ModelCard(
|
707 |
+
name="vampnet",
|
708 |
+
description="generating audio by filling in the blanks.",
|
709 |
+
author="hugo flores garcía et al. (descript/northwestern)",
|
710 |
+
tags=["sound", "generation",],
|
711 |
+
midi_in=False,
|
712 |
+
midi_out=False,
|
713 |
+
),
|
714 |
+
components=[
|
715 |
+
sampletemp, periodic_p, dropout, n_mask_codebooks, model_choice, beat_mask_ms
|
716 |
+
],
|
717 |
+
process_fn=harp_vamp,
|
718 |
+
)
|
719 |
+
|
720 |
try:
|
721 |
demo.queue()
|
722 |
demo.launch(share=True)
|