Download app.py from mcgi/32234324: direct link, hf CLI and curl.
- Browser
- Download file 393 Bytes
-
https://huggingface.co/spaces/mcgi/32234324/resolve/main/app.py
- Command line
-
hf download hf://spaces/mcgi/32234324/app.py
-
curl -L -o app.py https://huggingface.co/spaces/mcgi/32234324/resolve/main/app.py
393 Bytes
| import gradio as gr | |
| from TTS.api import TTS | |
| # مدل فارسی | |
| tts = TTS("Kamtera/persian-tts-female-vits", gpu=False) | |
| def tts_fn(text): | |
| output_file = "output.wav" | |
| tts.tts_to_file(text=text, file_path=output_file) | |
| return output_file | |
| iface = gr.Interface( | |
| fn=tts_fn, | |
| inputs="text", | |
| outputs=gr.Audio(type="filepath") | |
| ) | |
| # این خط ضروری است | |
| iface.launch() | |