feat: Enable MCP

#1
by multimodalart HF Staff - opened
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -12,6 +12,13 @@ def tts_gradio(text: str, voice: str) -> str:
12
  """
13
  调用 Qwen-TTS 接口合成语音,并将返回的 wav 保存到临时文件,
14
  返回文件路径给 Gradio 播放。
 
 
 
 
 
 
 
15
  """
16
  # 调用合成
17
  response = dashscope.audio.qwen_tts.SpeechSynthesizer.call(
@@ -44,11 +51,10 @@ demo = gr.Interface(
44
  ],
45
  outputs=gr.Audio(label="output"),
46
  title="Qwen-TTS Gradio demo",
47
- description="input text,choose speaker,click submit",
48
  allow_flagging="never",
49
  )
50
 
51
  if __name__ == "__main__":
52
  # 本地调试用:localhost:7860
53
- demo.launch(server_name="0.0.0.0", server_port=7860)
54
-
 
12
  """
13
  调用 Qwen-TTS 接口合成语音,并将返回的 wav 保存到临时文件,
14
  返回文件路径给 Gradio 播放。
15
+
16
+ Args:
17
+ text: The input text to be converted to speech.
18
+ voice: The voice/speaker to use for text-to-speech synthesis. Options include "Dylan", "Sunny", "Jada", "Cherry", "Ethan", "Serena", "Chelsie".
19
+
20
+ Returns:
21
+ The file path of the generated audio file in WAV format.
22
  """
23
  # 调用合成
24
  response = dashscope.audio.qwen_tts.SpeechSynthesizer.call(
 
51
  ],
52
  outputs=gr.Audio(label="output"),
53
  title="Qwen-TTS Gradio demo",
54
+ description="input text,choose speaker,click "submit"",
55
  allow_flagging="never",
56
  )
57
 
58
  if __name__ == "__main__":
59
  # 本地调试用:localhost:7860
60
+ demo.launch(server_name="0.0.0.0", server_port=7860, mcp_server=True)