Skip to content

Params max_len doesn't work #16

@kaka1909

Description

@kaka1909

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions