mirror of
https://github.com/openai/whisper.git
synced 2025-11-28 08:11:11 +00:00
Omit space prefix in initial_prompt for spaceless languages.
This commit is contained in:
parent
ba3f3cd54b
commit
21999e1702
@ -228,7 +228,8 @@ def transcribe(
|
||||
prompt_reset_since = 0
|
||||
|
||||
if initial_prompt is not None:
|
||||
initial_prompt_tokens = tokenizer.encode(" " + initial_prompt.strip())
|
||||
space = "" if language in {"zh", "ja", "th", "lo", "my", "yue"} else " "
|
||||
initial_prompt_tokens = tokenizer.encode(space + initial_prompt.strip())
|
||||
all_tokens.extend(initial_prompt_tokens)
|
||||
else:
|
||||
initial_prompt_tokens = []
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user