Spaces:
Sleeping
Sleeping
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() |