mrfakename commited on
Commit
8819fac
·
verified ·
1 Parent(s): 51e0928

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -0
app.py CHANGED
@@ -6,6 +6,8 @@ from utils import load_ckpt, print_colored
6
  from tokenizer import make_tokenizer
7
  from model import get_hertz_dev_config
8
  import matplotlib.pyplot as plt
 
 
9
 
10
  device = 'cuda' if T.cuda.is_available() else 'cpu'
11
  T.cuda.set_device(0)
@@ -127,3 +129,11 @@ def run(audio_path):
127
  completion = get_completion(encoded_prompt_audio, prompt_len)
128
  return display_audio(completion)
129
 
 
 
 
 
 
 
 
 
 
6
  from tokenizer import make_tokenizer
7
  from model import get_hertz_dev_config
8
  import matplotlib.pyplot as plt
9
+ import spaces
10
+ import gradio as gr
11
 
12
  device = 'cuda' if T.cuda.is_available() else 'cpu'
13
  T.cuda.set_device(0)
 
129
  completion = get_completion(encoded_prompt_audio, prompt_len)
130
  return display_audio(completion)
131
 
132
+
133
+
134
+ with gr.Blocks() as demo:
135
+ gr.Markdown("# hertz-dev")
136
+ inp = gr.Audio(label="Input Audio", type="filepath", interactive=True)
137
+ btn = gr.Button("Continue", variant="primary")
138
+ out = gr.Audio(label="Output", interactive=False)
139
+ btn.click(run, inputs=inp, outputs=out)