mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2025-09-10 17:14:36 +00:00
wav file resampling
This commit is contained in:
parent
62ab344b1e
commit
961c789c91
2 changed files with 46 additions and 10 deletions
|
@ -649,6 +649,8 @@ def whisper_generate(genparams):
|
|||
is_quiet = True if args.quiet else False
|
||||
prompt = genparams.get("prompt", "")
|
||||
audio_data = genparams.get("audio_data", "")
|
||||
if audio_data.startswith("data:audio"):
|
||||
audio_data = audio_data.split(",", 1)[1]
|
||||
inputs = whisper_generation_inputs()
|
||||
inputs.prompt = prompt.encode("UTF-8")
|
||||
inputs.audio_data = audio_data.encode("UTF-8")
|
||||
|
@ -660,7 +662,7 @@ def whisper_generate(genparams):
|
|||
return outstr
|
||||
|
||||
def utfprint(str):
|
||||
maxlen = 30000
|
||||
maxlen = 25000
|
||||
strlength = len(str)
|
||||
if strlength > maxlen: #limit max output len
|
||||
str = str[:maxlen] + f"... (+{strlength-maxlen} chars)"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue