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

POST to speech endpoint fail on longer input values #71

Open
KingDanx opened this issue Jan 17, 2025 · 2 comments
Open

POST to speech endpoint fail on longer input values #71

KingDanx opened this issue Jan 17, 2025 · 2 comments

Comments

@KingDanx
Copy link

From what I have observed if my input value is long enough (around 425 characters). I will get a 400 response and no audio is generated when stream is set to false.

If stream is not set to false I get a 200 response but no audio is generated

"steam": false

Image

Image

"stream":true

Image

Image

@remsky
Copy link
Owner

remsky commented Jan 17, 2025

That's interesting, I've run it with entire book chapters without issue. Though I was running through the python requests library.

Will take a look and see if I can reproduce

@KingDanx
Copy link
Author

More info on this:

The issue occurs when there is long bits of unpunctuated text, or long breaks between punctuation. The chunker.split_text() only seems to split text at punctuation. If there is no punctuation for a certain amount of characters, I think it should just yield a chunk to prevent the overflow error.

Examples:

No punctuation (no chunks):

Image

Image

Add 1 comma (Audio stops at the comma and overflows the rest)

Image

Image

Add 2 commas (Audio stops after the last comma and overflows the rest)

Image

Image

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

No branches or pull requests

2 participants