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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +40 -39
app.py CHANGED
@@ -35,48 +35,49 @@ with gr.Blocks() as block:
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]
 
 
 
 
 
 
 
 
 
74
 
75
- run_button.click(
76
- fn=generate_voice,
77
- inputs=inputs,
78
- outputs=outputs,
79
- queue=True
80
- )
 
 
 
 
81
 
82
- block.queue(concurrency_count=5).launch(debug=True)
 
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)