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

Add parameter maxLength to transcribe #3703

Conversation

youssefbenlemlih
Copy link
Contributor

@youssefbenlemlih youssefbenlemlih commented Apr 11, 2024

Fixes #3688

This PR adds the possibility to configure the max-length parameter that is passed to whisper.cpp (previously hard coded to 1).

The function transcribe now also accepts a parameter maxLength.

The parameter can only be also be set to null, to use whisper.cpp's default token grouping (useful for generating a movie-style transcription).

Backwards compatibility

The function is backward compatible. If maxLength is not provided, a default value of 1 is used (same behaviour as before)

Note

Since convertToCaptions groups the transcription-items and not the tokens, the parameter maxLength can now only be used when tokenLevelTimestamps is set false.

Question: Would tokensPerTranscriptionItem be a batter/more accurate name?

/claim 3688

Copy link

vercel bot commented Apr 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
bugs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 11, 2024 3:30pm
remotion ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 11, 2024 3:30pm

Copy link

algora-pbc bot commented Apr 11, 2024

💵 To receive payouts, sign up on Algora, link your Github account and connect with Stripe/Alipay.

@JonnyBurger
Copy link
Member

This is perfect! Thanks a lot!
And I agree with your idea, I renamed it to tokensPerItem.

@JonnyBurger JonnyBurger merged commit 9884382 into remotion-dev:main Apr 11, 2024
11 of 12 checks passed
@youssefbenlemlih youssefbenlemlih deleted the 3688-add-whisper-max-length-parameter branch April 11, 2024 17:24
@youssefbenlemlih
Copy link
Contributor Author

Thanks @JonnyBurger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add whisper max-length parameter
2 participants