Nymbo commited on
Commit
f524459
·
1 Parent(s): 2fd9e09

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +33 -35
app.py CHANGED
@@ -30,54 +30,52 @@ Eleven Multilingual V2 is the world's best Text-to-Speech model. Features 38 voi
30
  """
31
 
32
  with gr.Blocks() as block:
 
33
  gr.Markdown("# <center> ElevenLabs TTS </center>")
34
  gr.Markdown(description)
35
 
36
- all_voices = voices()
37
-
38
- with gr.Row(variant='panel'):
39
  input_api_key = gr.Textbox(
40
- type='password',
41
- label='Elevenlabs API Key',
42
- placeholder='Enter your API key',
43
- elem_id="input_api_key"
 
 
 
 
 
 
 
44
  )
45
 
 
46
  input_voice = gr.Dropdown(
47
  [ voice.name for voice in all_voices ],
48
  value="Rachel",
49
  label="Voice",
50
  elem_id="input_voice"
51
  )
52
-
53
- input_text = gr.Textbox(
54
- label="Input Text (4000 characters max)",
55
- lines=2,
56
- value="Hello! 你好! Hola! नमस्ते! Bonjour! こんにちは! مرحبا! 안녕하세요! Ciao! Cześć! Привіт! Γειά σας! Здравей! வணக்கம்!",
57
- elem_id="input_text"
58
- )
59
-
60
- run_button = gr.Button(
61
- text="Generate Voice",
62
- type="button"
63
- )
64
-
65
- out_audio = gr.Audio(
66
- label="Generated Voice",
67
- type="numpy",
68
- elem_id="out_audio",
69
- format="mp3"
70
- )
71
 
72
- inputs = [input_text, input_voice, input_api_key]
73
- outputs = [out_audio] # Added missing assignment
74
-
 
75
 
76
- run_button.click(
77
- fn=generate_voice,
78
- inputs=inputs,
79
- outputs=outputs,
80
- queue=True
81
- )
 
 
 
 
 
 
 
 
 
 
82
 
83
  block.queue(concurrency_count=5).launch(debug=True)
 
30
  """
31
 
32
  with gr.Blocks() as block:
33
+ #gr.Markdown('[ ![ElevenLabs](https://user-images.githubusercontent.com/12028621/262629275-4f85c9cf-85b6-435e-ab50-5b8c7c4e9dd2.png) ](https://elevenlabs.io)')
34
  gr.Markdown("# <center> ElevenLabs TTS </center>")
35
  gr.Markdown(description)
36
 
 
 
 
37
  input_api_key = gr.Textbox(
38
+ type='password',
39
+ label='Elevenlabs API Key',
40
+ placeholder='Enter your API key',
41
+ elem_id="input_api_key"
42
+ )
43
+
44
+ input_text = gr.Textbox(
45
+ label="Input Text (4000 characters max)",
46
+ lines=2,
47
+ value="Hello! 你好! Hola! नमस्ते! Bonjour! こんにちは! مرحبا! 안녕하세요! Ciao! Cześć! Привіт! Γειά σας! Здравей! வணக்கம்!",
48
+ elem_id="input_text"
49
  )
50
 
51
+ all_voices = voices()
52
  input_voice = gr.Dropdown(
53
  [ voice.name for voice in all_voices ],
54
  value="Rachel",
55
  label="Voice",
56
  elem_id="input_voice"
57
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
 
59
+ run_button = gr.Button(
60
+ text="Generate Voice",
61
+ type="button"
62
+ )
63
 
64
+ out_audio = gr.Audio(
65
+ label="Generated Voice",
66
+ type="numpy",
67
+ elem_id="out_audio",
68
+ format="mp3"
69
+ )
70
+
71
+ inputs = [input_text, input_voice, input_api_key]
72
+ outputs = [out_audio]
73
+
74
+ run_button.click(
75
+ fn=generate_voice,
76
+ inputs=inputs,
77
+ outputs=outputs,
78
+ queue=True
79
+ )
80
 
81
  block.queue(concurrency_count=5).launch(debug=True)