Spaces:
Paused
Paused
Commit
·
8a1ba2b
1
Parent(s):
5bd7020
feat: add concurrency, logo
Browse files
app.py
CHANGED
|
@@ -13,7 +13,12 @@ def pad_buffer(audio):
|
|
| 13 |
|
| 14 |
def generate_voice(text, voice_name, model_name, api_key):
|
| 15 |
try:
|
| 16 |
-
audio = generate(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
except UnauthenticatedRateLimitError as e:
|
| 18 |
raise gr.Error("Thanks for trying out ElevenLabs TTS! You've reached the free tier limit. Please provide an API key to continue.")
|
| 19 |
except Exception as e:
|
|
@@ -45,7 +50,7 @@ A demo of the world's most advanced TTS systems, made by [ElevenLabs](https://el
|
|
| 45 |
"""
|
| 46 |
|
| 47 |
with gr.Blocks() as block:
|
| 48 |
-
gr.Markdown(
|
| 49 |
gr.Markdown(badges)
|
| 50 |
gr.Markdown(description)
|
| 51 |
|
|
@@ -98,5 +103,4 @@ with gr.Blocks() as block:
|
|
| 98 |
queue=True
|
| 99 |
)
|
| 100 |
|
| 101 |
-
block.queue()
|
| 102 |
-
block.launch()
|
|
|
|
| 13 |
|
| 14 |
def generate_voice(text, voice_name, model_name, api_key):
|
| 15 |
try:
|
| 16 |
+
audio = generate(
|
| 17 |
+
text,
|
| 18 |
+
voice=voice_name,
|
| 19 |
+
model=model_name,
|
| 20 |
+
api_key=api_key if api_key != '' else None
|
| 21 |
+
)
|
| 22 |
except UnauthenticatedRateLimitError as e:
|
| 23 |
raise gr.Error("Thanks for trying out ElevenLabs TTS! You've reached the free tier limit. Please provide an API key to continue.")
|
| 24 |
except Exception as e:
|
|
|
|
| 50 |
"""
|
| 51 |
|
| 52 |
with gr.Blocks() as block:
|
| 53 |
+
gr.Markdown('[  ](https://elevenlabs.io)')
|
| 54 |
gr.Markdown(badges)
|
| 55 |
gr.Markdown(description)
|
| 56 |
|
|
|
|
| 103 |
queue=True
|
| 104 |
)
|
| 105 |
|
| 106 |
+
block.queue(max_size=99, concurrency_count=1).launch(debug=True)
|
|
|