Spaces:
Running
Running
examples
Browse files- app.py +1 -1
- ui_layout.py +2 -2
- utils/openai_tts.py +1 -1
app.py
CHANGED
@@ -200,7 +200,7 @@ with gr.Blocks(theme=gr.themes.Soft(), elem_id="main_blocks_ui") as demo:
|
|
200 |
example_outputs_list = [individual_lines_zip_output, merged_dialogue_mp3_output, status_output]
|
201 |
example_process_fn = partial(handle_script_processing, OPENAI_API_KEY, async_openai_client, NSFW_API_URL_TEMPLATE)
|
202 |
|
203 |
-
|
204 |
inputs_for_examples=example_inputs_list,
|
205 |
process_fn=example_process_fn if OPENAI_API_KEY else None,
|
206 |
outputs_for_examples=example_outputs_list if OPENAI_API_KEY else None
|
|
|
200 |
example_outputs_list = [individual_lines_zip_output, merged_dialogue_mp3_output, status_output]
|
201 |
example_process_fn = partial(handle_script_processing, OPENAI_API_KEY, async_openai_client, NSFW_API_URL_TEMPLATE)
|
202 |
|
203 |
+
create_examples_ui(
|
204 |
inputs_for_examples=example_inputs_list,
|
205 |
process_fn=example_process_fn if OPENAI_API_KEY else None,
|
206 |
outputs_for_examples=example_outputs_list if OPENAI_API_KEY else None
|
ui_layout.py
CHANGED
@@ -19,10 +19,10 @@ try:
|
|
19 |
from utils.openai_tts import OPENAI_VOICES as ALL_TTS_VOICES
|
20 |
APP_AVAILABLE_VOICES = ALL_TTS_VOICES.copy()
|
21 |
if not APP_AVAILABLE_VOICES: # Fallback if OPENAI_VOICES is empty
|
22 |
-
APP_AVAILABLE_VOICES = ["alloy", "ash", "ballad", "coral", "echo", "fable", "onyx", "sage", "nova", "shimmer"]
|
23 |
except ImportError:
|
24 |
print("Warning: Could not import OPENAI_VOICES from utils.openai_tts. Using default list.")
|
25 |
-
APP_AVAILABLE_VOICES = ["alloy", "ash", "ballad", "coral", "echo", "fable", "onyx", "sage", "nova", "shimmer"]
|
26 |
|
27 |
PREDEFINED_VIBES = {
|
28 |
"None": "", "Calm": "Speak in a calm, composed, and relaxed manner.",
|
|
|
19 |
from utils.openai_tts import OPENAI_VOICES as ALL_TTS_VOICES
|
20 |
APP_AVAILABLE_VOICES = ALL_TTS_VOICES.copy()
|
21 |
if not APP_AVAILABLE_VOICES: # Fallback if OPENAI_VOICES is empty
|
22 |
+
APP_AVAILABLE_VOICES = ["alloy", "ash", "ballad", "coral", "echo", "fable", "onyx", "sage", "nova", "shimmer", "verse"]
|
23 |
except ImportError:
|
24 |
print("Warning: Could not import OPENAI_VOICES from utils.openai_tts. Using default list.")
|
25 |
+
APP_AVAILABLE_VOICES = ["alloy", "ash", "ballad", "coral", "echo", "fable", "onyx", "sage", "nova", "shimmer", "verse"]
|
26 |
|
27 |
PREDEFINED_VIBES = {
|
28 |
"None": "", "Calm": "Speak in a calm, composed, and relaxed manner.",
|
utils/openai_tts.py
CHANGED
@@ -5,7 +5,7 @@ from openai import AsyncOpenAI, OpenAIError, RateLimitError
|
|
5 |
import httpx # For NSFW check
|
6 |
import urllib.parse # For URL encoding text in NSFW check
|
7 |
|
8 |
-
OPENAI_VOICES = ["alloy", "ash", "ballad", "coral", "echo", "fable", "onyx", "sage", "nova", "shimmer"]
|
9 |
|
10 |
# Concurrency limiter for OpenAI API calls
|
11 |
MAX_CONCURRENT_REQUESTS = 2
|
|
|
5 |
import httpx # For NSFW check
|
6 |
import urllib.parse # For URL encoding text in NSFW check
|
7 |
|
8 |
+
OPENAI_VOICES = ["alloy", "ash", "ballad", "coral", "echo", "fable", "onyx", "sage", "nova", "shimmer", "verse"]
|
9 |
|
10 |
# Concurrency limiter for OpenAI API calls
|
11 |
MAX_CONCURRENT_REQUESTS = 2
|