mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2025-09-10 17:14:36 +00:00
added multilingual support for whisper
This commit is contained in:
parent
0cb599546e
commit
91b6e29af3
6 changed files with 49 additions and 8 deletions
|
@ -273,6 +273,7 @@ class whisper_generation_inputs(ctypes.Structure):
|
|||
_fields_ = [("prompt", ctypes.c_char_p),
|
||||
("audio_data", ctypes.c_char_p),
|
||||
("suppress_non_speech", ctypes.c_bool),
|
||||
("langcode", ctypes.c_char_p),
|
||||
("quiet", ctypes.c_bool)]
|
||||
|
||||
class whisper_generation_outputs(ctypes.Structure):
|
||||
|
@ -1252,6 +1253,9 @@ def whisper_generate(genparams):
|
|||
inputs.prompt = prompt.encode("UTF-8")
|
||||
inputs.audio_data = audio_data.encode("UTF-8")
|
||||
inputs.quiet = is_quiet
|
||||
lc = genparams.get("langcode", "auto")
|
||||
lc = lc.strip().lower() if (lc and lc.strip().lower()!="") else "auto"
|
||||
inputs.langcode = lc.encode("UTF-8")
|
||||
inputs.suppress_non_speech = genparams.get("suppress_non_speech", False)
|
||||
ret = handle.whisper_generate(inputs)
|
||||
outstr = ""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue