File size: 380 Bytes
4346cc1
 
6ce5498
d68b782
 
 
 
 
 
 
6ce5498
d68b782
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import gradio as gr
import torch

# 假设模型是一个声音合成模型
def synthesize_speech(text):
    model = torch.load("your_model.pth")
    model.eval()
    # 假设你的模型有一个名为 synthesize 的方法
    audio_output = model.synthesize(text)
    return audio_output

gr.Interface(
    fn=synthesize_speech,
    inputs="text",
    outputs="audio"
).launch()