mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-09-11 07:19:10 +02:00
added multilingual support for whisper
This commit is contained in:
@@ -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 = ""
|
||||
|
||||
Reference in New Issue
Block a user