Tonic commited on
Commit
e660ba9
1 Parent(s): 604682d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -18,7 +18,6 @@ Join us : 🌟TeamTonic🌟 is always making cool demos! Join our active builder
18
  def whisper_speech_demo(text, lang, speaker_audio=None, mix_lang=None, mix_text=None):
19
  pipe = Pipeline()
20
 
21
- # Use uploaded speaker audio if provided
22
  speaker_url = None
23
  if speaker_audio is not None:
24
  speaker_url = speaker_audio.name
@@ -43,13 +42,13 @@ with gr.Blocks() as demo:
43
  with gr.Row():
44
  text_input = gr.Textbox(label="Enter text")
45
  lang_input = gr.Dropdown(choices=list(LANGUAGES.keys()), label="Language")
46
- speaker_input = gr.File(label="Upload Speaker Audio (optional)", type="file", accepts=["audio/*"])
47
  with gr.Row():
48
  mix_lang_input = gr.Textbox(label="Mixed Languages (optional, comma-separated)", placeholder="e.g., en,pl")
49
  mix_text_input = gr.Textbox(label="Mixed Texts (optional, for mixed languages)", placeholder="e.g., Hello, Cześć")
50
  with gr.Row():
51
  submit_button = gr.Button("Generate Speech")
52
- output_audio = gr.Audio(label="Generated Speech")
53
 
54
  submit_button.click(
55
  whisper_speech_demo,
 
18
  def whisper_speech_demo(text, lang, speaker_audio=None, mix_lang=None, mix_text=None):
19
  pipe = Pipeline()
20
 
 
21
  speaker_url = None
22
  if speaker_audio is not None:
23
  speaker_url = speaker_audio.name
 
42
  with gr.Row():
43
  text_input = gr.Textbox(label="Enter text")
44
  lang_input = gr.Dropdown(choices=list(LANGUAGES.keys()), label="Language")
45
+ speaker_input = gr.Audio(label="Upload or Record Speaker Audio (optional)", sources=["upload", "microphone"], type="filepath")
46
  with gr.Row():
47
  mix_lang_input = gr.Textbox(label="Mixed Languages (optional, comma-separated)", placeholder="e.g., en,pl")
48
  mix_text_input = gr.Textbox(label="Mixed Texts (optional, for mixed languages)", placeholder="e.g., Hello, Cześć")
49
  with gr.Row():
50
  submit_button = gr.Button("Generate Speech")
51
+ output_audio = gr.Audio(label="🌬️💬📝WhisperSpeech")
52
 
53
  submit_button.click(
54
  whisper_speech_demo,