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

Params max_len doesn't work #16

Open
kaka1909 opened this issue Nov 29, 2023 · 0 comments
Open

Params max_len doesn't work #16

kaka1909 opened this issue Nov 29, 2023 · 0 comments

Comments

@kaka1909
Copy link

Thank you for your wonderful work~!!!! This is really remarkable.

But I got a problem, I wanna set the max_len = 1 to get word timing, so I fork the repo, and add the param

class Whisper():
    WHISPER_SR = 16000

    def __init__(self, model_path, strategy=0, n_threads=1, max_len=1):
        self.context = whisper_cpp.whisper_init_from_file(model_path.encode('utf-8'))
        self.params = whisper_cpp.whisper_full_default_params(strategy)
        self.params.n_threads = n_threads
        **self.params.max_len = max_len  # here i add the max_len in to params**
        self.params.print_special = False
        self.params.print_progress = False
        self.params.print_realtime = False
        self.params.print_timestamps = True

But it does not work after I check the output, can you help to figure out the problem? Much thanks

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

1 participant