Delete app.py
Browse files
app.py
DELETED
|
@@ -1,35 +0,0 @@
|
|
| 1 |
-
import gradio as gr
|
| 2 |
-
from TTS.api import TTS
|
| 3 |
-
import os
|
| 4 |
-
|
| 5 |
-
# मॉडल लोड करना (इसे थोड़ा समय लगेगा, धैर्य रखें)
|
| 6 |
-
print("Loading Alex Cloner...")
|
| 7 |
-
tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2")
|
| 8 |
-
|
| 9 |
-
def alex_clone(text, audio_file):
|
| 10 |
-
if audio_file is None:
|
| 11 |
-
return "Deepak भाई, पहले Alex का सैंपल तो डालो!"
|
| 12 |
-
|
| 13 |
-
output_path = "output.wav"
|
| 14 |
-
# क्लॉनिंग और जनरेशन
|
| 15 |
-
tts.tts_to_file(
|
| 16 |
-
text=text,
|
| 17 |
-
speaker_wav=audio_file,
|
| 18 |
-
language="hi", # हिंदी के लिए
|
| 19 |
-
file_path=output_path
|
| 20 |
-
)
|
| 21 |
-
return output_path
|
| 22 |
-
|
| 23 |
-
with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
| 24 |
-
gr.Markdown("# 🎭 Alex Expressive Voice Clone (PRO)")
|
| 25 |
-
with gr.Row():
|
| 26 |
-
with gr.Column():
|
| 27 |
-
input_text = gr.Textbox(label="Text (Hindi/English)", lines=4)
|
| 28 |
-
ref_audio = gr.Audio(label="Upload Alex Sample (10-15s)", type="filepath")
|
| 29 |
-
btn = gr.Button("Magic Generate ✨", variant="primary")
|
| 30 |
-
audio_out = gr.Audio(label="Alex's Voice")
|
| 31 |
-
|
| 32 |
-
btn.click(alex_clone, inputs=[input_text, ref_audio], outputs=audio_out)
|
| 33 |
-
|
| 34 |
-
if __name__ == "__main__":
|
| 35 |
-
demo.launch(server_name="0.0.0.0", server_port=7860)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|