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

Support max_characters for text to speech models/drivers #1149

Open
1 task done
vachillo opened this issue Sep 6, 2024 · 1 comment
Open
1 task done

Support max_characters for text to speech models/drivers #1149

vachillo opened this issue Sep 6, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@vachillo
Copy link
Member

vachillo commented Sep 6, 2024

Is your feature request related to a problem? Please describe.
OpenAI's tts-1 model has an input character limit of 4096. The driver should be updated to split up API calls with this max limit in mind.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@vachillo vachillo added the enhancement New feature or request label Sep 6, 2024
@collindutter
Copy link
Member

I'm not sure this necessarily needs to live in the framework. We don't really prevent max input size for basic Driver interactions. We could put this logic in an Engine, but that feels overkill. In the case of the PromptSummaryEngine there is some complexity in summarizing as much text as possible while maintaining a running summary. But I don't think the same complexity exists for this use-case.

Pulling a snippet you've shared:

        prompt_str = self.prompt_joiner.join(prompts).strip()
        new_prompts = [
            prompt_str[i : i + self.text_to_speech_driver.max_characters]
            for i in range(0, len(prompt_str), self.text_to_speech_driver.max_characters)
        ]
        return [self.text_to_speech_driver.try_text_to_audio(prompt=prompt) for prompt in new_prompts]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants