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

initial_prompt influences transciption result wrongly #10

Open
chesha1 opened this issue Feb 4, 2023 · 0 comments
Open

initial_prompt influences transciption result wrongly #10

chesha1 opened this issue Feb 4, 2023 · 0 comments

Comments

@chesha1
Copy link

chesha1 commented Feb 4, 2023

When using initial prompts, result of batch-whisper is different from official whisper and it will also lose the first few words of the reslut.
That is,

  1. whisper without initial prompt:
    result["text"] = 'abcdefg'
    result["segments"][0]["text"] = 'abcdefg'
  2. whisper with initial prompt:
    result["text"] = 'abcdefg'
    result["segments"][0]["text"] = 'abc, defg'
  3. batch-whisper without initial prompt:
    same with 1
  4. batch-whisper with initial prompt:
    result["text"] = 'bcdefg'
    result["segments"][0]["text"] = 'abcdefg'

Part of codes are below:

    audio_list = list()
    for k in range(batch_size):
        audio_list.append(load_audio(path + file_list[idx + k], sr=16000))
    prompt = ["以下是普通话的句子。"] * batch_size
    result = model.transcribe(audio_list, language='zh', task='transcribe', fp16=False,
                              initial_prompt=prompt)
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