Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -200,7 +200,7 @@ def harp_vamp(input_audio_file, periodic_p, n_mask_codebooks, pitch_shift_amt):
|
|
200 |
OUT_DIR.mkdir(exist_ok=True)
|
201 |
outpath = OUT_DIR / f"{uuid.uuid4()}.wav"
|
202 |
sig.write(outpath)
|
203 |
-
return outpath
|
204 |
|
205 |
|
206 |
with gr.Blocks() as demo:
|
@@ -420,30 +420,23 @@ with gr.Blocks() as demo:
|
|
420 |
api_name="vamp"
|
421 |
)
|
422 |
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
harp_in = gr.Audio(label="input audio", type="filepath", visible=False)
|
434 |
-
harp_out = gr.Audio(label="output audio", type="filepath", visible=False)
|
435 |
-
build_endpoint(
|
436 |
-
components=[
|
437 |
-
periodic_p,
|
438 |
-
n_mask_codebooks,
|
439 |
-
],
|
440 |
-
process_fn=harp_vamp,
|
441 |
-
model_card=card
|
442 |
-
)
|
443 |
# Build a HARP-compatible endpoint
|
444 |
-
app = build_endpoint(model_card=
|
445 |
-
components=
|
446 |
-
|
|
|
|
|
|
|
447 |
|
448 |
app.queue()
|
449 |
app.launch(share=True)
|
|
|
200 |
OUT_DIR.mkdir(exist_ok=True)
|
201 |
outpath = OUT_DIR / f"{uuid.uuid4()}.wav"
|
202 |
sig.write(outpath)
|
203 |
+
return outpath, []
|
204 |
|
205 |
|
206 |
with gr.Blocks() as demo:
|
|
|
420 |
api_name="vamp"
|
421 |
)
|
422 |
|
423 |
+
from pyharp import ModelCard, build_endpoint
|
424 |
+
card = ModelCard(
|
425 |
+
name="vampnet",
|
426 |
+
description="vampnet is a model for generating audio from audio",
|
427 |
+
author="hugo flores garcía",
|
428 |
+
tags=["music generation"],
|
429 |
+
midi_in=False,
|
430 |
+
midi_out=False
|
431 |
+
)
|
432 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
433 |
# Build a HARP-compatible endpoint
|
434 |
+
app = build_endpoint(model_card=card,
|
435 |
+
components=[
|
436 |
+
periodic_p,
|
437 |
+
n_mask_codebooks,
|
438 |
+
],
|
439 |
+
process_fn=harp_vamp)
|
440 |
|
441 |
app.queue()
|
442 |
app.launch(share=True)
|