pywhispercpp icon indicating copy to clipboard operation
pywhispercpp copied to clipboard

what's the cpp version pywhispercpp bind to?

Open zillionare opened this issue 1 year ago • 13 comments

Forgive me if the question is dumb. I'm totally unfamiliar with pybind. But when I compare pywhispercpp and whispercpp cli, I found the difference.

The comparison is under same conditions:

  1. same prompt: "好,我们开始上课。请输出简体中文,以下是专有名词“ (means: ok, let's start the lesson. Please output zh-cn, not zh-tw"
  2. this is how cpp is invoked: ./main -l zh -t 8 -m models/ggml-large-v2.bin -osrt --prompt '好,我们开始上课.请输出简体中文' -of /tmp/whisper.cpp.srt /tmp/output005.wav
  3. this is how I construct pywhispercpp model:
    model = Model(model, 
                  n_threads=8,
                  n_max_text_ctx=448,
                  max_len=30,
                  split_on_word=True,
                  initial_prompt=prompt,
                  language="zh"
                  )
    segments = model.transcribe(input_audio, new_segment_callback=new_segment_callback)

however, pywhispercpp yields traditional Chinese characters, and its output is not as accurate as whispercpp.

So, is there any difference between pywhispercpp and whispercpp? The version of whispercpp I used is 1.7.1, released four days ago, so I wonder pywhispercpp has not bound to latest one yet?

zillionare avatar Oct 11 '24 03:10 zillionare

@zillionare, how did you install pywhispercpp, through pip or from source ?

absadiki avatar Oct 11 '24 20:10 absadiki

can't remember exactly and can't find by history command( weired). But I should follow the readme, so it is probably pip install pywhispercpp.

zillionare avatar Oct 12 '24 08:10 zillionare

yeah, the pypi version is very old, I am planning to release a new version soon. Please compile it from source for now and let me know if you still have issues. Make sure to remove the old pypi version or create a new virtual env.

absadiki avatar Oct 12 '24 22:10 absadiki

Hi, does the master branch update to date now?

THIS is the only whipser.cpp bind that looks like good.

MonolithFoundation avatar Dec 10 '24 03:12 MonolithFoundation

Hi, does the master branch update to date now?

THIS is the only whipser.cpp bind that looks like good.

Hi @MonolithFoundation, The PYPI wheels are up to date with the main branch.

absadiki avatar Dec 10 '24 19:12 absadiki

Hi,is there any way to set language='en' or other lans same as transformers whisper pipeline?

it can be achieved by sepcific some decoder id

MonolithFoundation avatar Dec 11 '24 03:12 MonolithFoundation

Hi,is there any way to set language='en' or other lans same as transformers whisper pipeline?

it can be achieved by sepcific some decoder id

Yes, you can set the language parameter in the transcribe function to any language code supported by whisper. Take a look at the docs to see all the parameters you can use.

absadiki avatar Dec 11 '24 22:12 absadiki

hi, another question would be, what if i have VAD already, how to transcribe without timestamp output?

MonolithFoundation avatar Dec 12 '24 02:12 MonolithFoundation

hi, another question would be, what if i have VAD already, how to transcribe without timestamp output?

Each segment output has t0, t1 and text; if you are using a VAD, you can use the text attribute and ignore the timestamps very simply.

absadiki avatar Dec 12 '24 19:12 absadiki

thanks so much.

I have a Chinese finetune whisperv3-turbo model from community, do u know why it can not inference with pywhispercpp?

(the offcial turbo model is ok).

https://huggingface.co/BELLE-2/Belle-whisper-large-v3-turbo-zh-ggml/tree/main

This load got some key errors. It's the ggml version too old or pywhispercpp too old?

MonolithFoundation avatar Dec 13 '24 02:12 MonolithFoundation

@MonolithFoundation, Is it working with the actual version whisper.cpp ? if not then maybe your ggml is too old. Otherwise please open a new issue with the errors you are getting.

absadiki avatar Dec 13 '24 20:12 absadiki

I suspect that the ggml model version might be too old. Is there any tool that can convert this ggml to the newest version? Or can pywhispercapp directly load the pth model (or the transformers version) and convert it to ggml upon first loading?

MonolithFoundation avatar Dec 16 '24 03:12 MonolithFoundation

pywhispercpp cannot load pt models directly, but the conversion script is already available in the whisper.cpp repo, you can use it to convert that model and use it with pywhiserpercpp.

absadiki avatar Dec 16 '24 19:12 absadiki