Download app.py from arm-inas/AutoDub: direct link, hf CLI and curl.
- Browser
- Download file 889 Bytes
-
https://huggingface.co/spaces/arm-inas/AutoDub/resolve/main/app.py
- Command line
-
hf download hf://spaces/arm-inas/AutoDub/app.py
-
curl -L -o app.py https://huggingface.co/spaces/arm-inas/AutoDub/resolve/main/app.py
889 Bytes
| import gradio as gr | |
| from utils.stt import transcribe_audio | |
| from utils.translate import translate_text | |
| from utils.tts import text_to_speech | |
| def process(audio, target_lang): | |
| text = transcribe_audio(audio) | |
| translated = translate_text(text, target_lang) | |
| speech_path = text_to_speech(translated) | |
| return text, translated, speech_path | |
| iface = gr.Interface( | |
| fn=process, | |
| inputs=[ | |
| gr.Audio(type="filepath", label="Ses Yükle (.wav/mp3)"), | |
| gr.Dropdown(["en", "de", "fr", "tr"], label="Hedef Dil") | |
| ], | |
| outputs=[ | |
| gr.Textbox(label="Transkrip"), | |
| gr.Textbox(label="Çeviri"), | |
| gr.Audio(label="Konuşma (TTS)") | |
| ], | |
| title="Ses Tabanlı Çeviri", | |
| description="Bir ses dosyasını yükleyin, otomatik olarak yazıya dökülsün, çevrilsin ve tekrar sese dönüştürülsün." | |
| ) | |
| if __name__ == "__main__": | |
| iface.launch() | |