File size: 496 Bytes
b725c5a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import gradio as gr
import os
import torch



def build_codec():
    ...

def build_model():
    ...

def ns2_inference(
        prmopt_audio_path,
        text,
        diffusion_steps=100,
):
    device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')

demo_inputs = ...
demo_outputs = ...

demo = gr.Interface(
    fn=ns2_inference,
    inputs=demo_inputs,
    outputs=demo_outputs,
    title="Amphion Zero-Shot TTS NaturalSpeech2"
)

if __name__ == "__main__":
    demo.launch()