Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow changing the model to use #5

Merged
merged 4 commits into from Dec 13, 2023
Merged

Conversation

mikolysz
Copy link
Contributor

@mikolysz mikolysz commented Nov 7, 2023

This PR adds a -m flag which lets the user switch between the tts-1 and tts-1-hd models.

@tomviner
Copy link

This would fix #10

@@ -7,14 +7,15 @@
from pydub.playback import play

VOICES = ["alloy", "echo", "fable", "onyx", "nova", "shimmer"]
MODELS = ["tts-1", "tts-1-hd"]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current list for my account contains:

canary-tts
tts-1
tts-1-1106
tts-1-hd
tts-1-hd-1106

This is subject to arbitrary change, so I wonder if it might be best to avoid a hardcoded list. Instead, catch the missing model error:

openai.NotFoundError: Error code: 404 - {'error': {'message': 'The model `dummy` does not exist', 'type': 'invalid_request_error', 'param': None, 'code': 'model_not_found'}}

@simonw
Copy link
Owner

simonw commented Dec 13, 2023

I'm going to merge this and then apply Tom's suggestion.

@simonw simonw merged commit 327e227 into simonw:main Dec 13, 2023
10 checks passed
simonw added a commit that referenced this pull request Dec 13, 2023
simonw added a commit that referenced this pull request Dec 13, 2023
simonw added a commit that referenced this pull request Dec 13, 2023
Refs #3, #4, #5, #7, #8, #10, #12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants