Skip to content

Commit

Permalink
fix bad openai default voice name
Browse files Browse the repository at this point in the history
  • Loading branch information
devxpy committed Jul 5, 2024
1 parent 3cd8bf8 commit 3937e2c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
11 changes: 3 additions & 8 deletions daras_ai_v2/text_to_speech_settings_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import gooey_ui as st
from daras_ai_v2 import settings
from daras_ai_v2.custom_enum import GooeyEnum
from daras_ai_v2.enum_selector_widget import enum_selector
from daras_ai_v2.exceptions import raise_for_status
from daras_ai_v2.redis_cache import redis_cache_decorator
Expand All @@ -28,15 +29,12 @@
}


class OpenAI_TTS_Models(str, Enum):
class OpenAI_TTS_Models(GooeyEnum):
tts_1 = "tts-1"
tts_1_hd = "tts-1-hd"


OPENAI_TTS_MODELS_T = typing.Literal[tuple(e.name for e in OpenAI_TTS_Models)]


class OpenAI_TTS_Voices(str, Enum):
class OpenAI_TTS_Voices(GooeyEnum):
alloy = "alloy"
echo = "echo"
fable = "fable"
Expand All @@ -45,9 +43,6 @@ class OpenAI_TTS_Voices(str, Enum):
shimmer = "shimmer"


OPENAI_TTS_VOICES_T = typing.Literal[tuple(e.name for e in OpenAI_TTS_Voices)]


class TextToSpeechProviders(Enum):
GOOGLE_TTS = "Google Text-to-Speech"
ELEVEN_LABS = "Eleven Labs"
Expand Down
8 changes: 2 additions & 6 deletions recipes/TextToSpeech.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
TextToSpeechProviders,
text_to_speech_provider_selector,
azure_tts_voices,
OPENAI_TTS_MODELS_T,
OPENAI_TTS_VOICES_T,
OpenAI_TTS_Models,
OpenAI_TTS_Voices,
OLD_ELEVEN_LABS_VOICES,
Expand Down Expand Up @@ -56,8 +54,8 @@ class TextToSpeechSettings(BaseModel):

azure_voice_name: str | None

openai_voice_name: OPENAI_TTS_VOICES_T | None
openai_tts_model: OPENAI_TTS_MODELS_T | None
openai_voice_name: OpenAI_TTS_Voices.api_choices | None
openai_tts_model: OpenAI_TTS_Models.api_choices | None


class TextToSpeechPage(BasePage):
Expand All @@ -81,8 +79,6 @@ class TextToSpeechPage(BasePage):
"elevenlabs_model": "eleven_multilingual_v2",
"elevenlabs_stability": 0.5,
"elevenlabs_similarity_boost": 0.75,
"openai_voice_name": "alloy",
"openai_tts_model": "tts-1",
}

class RequestModelBase(BasePage.RequestModel):
Expand Down

0 comments on commit 3937e2c

Please sign in to comment.