Skip to content

Commit

Permalink
Reformat with black
Browse files Browse the repository at this point in the history
  • Loading branch information
nikochiko committed Oct 3, 2023
1 parent 0357e02 commit f967a24
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions recipes/TextToSpeech.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,19 +229,13 @@ def run(self, state: dict):
default_voice_model = next(iter(ELEVEN_LABS_MODELS.values()))

voice_id = ELEVEN_LABS_VOICES.get(
state.get("elevenlabs_voice_name"),
default_voice_id
state.get("elevenlabs_voice_name"), default_voice_id
)
voice_model = ELEVEN_LABS_MODELS.get(
state.get("elevenlabs_model"),
default_voice_model,
)
stability = state.get(
"elevenlabs_stability", 0.5,
)
similarity_boost = state.get(
"elevenlabs_similarity_boost", 0.75,
state.get("elevenlabs_model"), default_voice_model
)
stability = state.get("elevenlabs_stability", 0.5)
similarity_boost = state.get("elevenlabs_similarity_boost", 0.75)

response = requests.post(
f"https://api.elevenlabs.io/v1/text-to-speech/{voice_id}",
Expand All @@ -261,8 +255,9 @@ def run(self, state: dict):
response.raise_for_status()

yield "Uploading Audio file..."
state["audio_url"] = upload_file_from_bytes("elevenlabs_gen.mp3", response.content)

state["audio_url"] = upload_file_from_bytes(
"elevenlabs_gen.mp3", response.content
)

def related_workflows(self) -> list:
from recipes.VideoBots import VideoBotsPage
Expand Down

0 comments on commit f967a24

Please sign in to comment.