update docs, added gui for whisper

This commit is contained in:
Concedo 2024-06-01 02:01:49 +08:00
parent 961c789c91
commit a65e0800ab
5 changed files with 584 additions and 158 deletions

View file

@ -662,7 +662,7 @@ def whisper_generate(genparams):
return outstr
def utfprint(str):
maxlen = 25000
maxlen = 20000
strlength = len(str)
if strlength > maxlen: #limit max output len
str = str[:maxlen] + f"... (+{strlength-maxlen} chars)"
@ -705,7 +705,7 @@ maxhordelen = 256
modelbusy = threading.Lock()
requestsinqueue = 0
defaultport = 5001
KcppVersion = "1.66.1"
KcppVersion = "1.67"
showdebug = True
showsamplerwarning = True
showmaxctxwarning = True
@ -1703,7 +1703,7 @@ def show_new_gui():
tabs = ctk.CTkFrame(root, corner_radius = 0, width=windowwidth, height=windowheight-50)
tabs.grid(row=0, stick="nsew")
tabnames= ["Quick Launch", "Hardware", "Tokens", "Model Files", "Network", "Horde Worker","Image Gen"]
tabnames= ["Quick Launch", "Hardware", "Tokens", "Model Files", "Network", "Horde Worker","Image Gen","Audio"]
navbuttons = {}
navbuttonframe = ctk.CTkFrame(tabs, width=100, height=int(tabs.cget("height")))
navbuttonframe.grid(row=0, column=0, padx=2,pady=2)
@ -1807,6 +1807,8 @@ def show_new_gui():
sd_threads_var = ctk.StringVar(value=str(default_threads))
sd_quant_var = ctk.IntVar(value=0)
whisper_model_var = ctk.StringVar()
def tabbuttonaction(name):
for t in tabcontent:
if name == t:
@ -2327,9 +2329,13 @@ def show_new_gui():
sdvaeitem3.grid(row=15,column=1,stick="nw")
makecheckbox(images_tab, "Use TAE SD (AutoFix Broken VAE)", sd_vaeauto_var, 16,command=toggletaesd,tooltiptxt="Replace VAE with TAESD. May fix bad VAE.")
# audio tab
audio_tab = tabcontent["Audio"]
makefileentry(audio_tab, "Whisper Model:", "Select Whisper .bin Model File", whisper_model_var, 1, filetypes=[("*.bin","*.bin")], tooltiptxt="Select a Whisper .bin model file on disk to be loaded.")
# launch
def guilaunch():
if model_var.get() == "" and sd_model_var.get() == "":
if model_var.get() == "" and sd_model_var.get() == "" and whisper_model_var.get() == "":
tmp = askopenfilename(title="Select ggml model .bin or .gguf file")
model_var.set(tmp)
nonlocal nextstate
@ -2446,6 +2452,9 @@ def show_new_gui():
else:
args.sdlora = ""
if whisper_model_var.get() != "":
args.whispermodel = whisper_model_var.get()
def import_vars(dict):
dict = convert_outdated_args(dict)
@ -2584,6 +2593,8 @@ def show_new_gui():
sd_lora_var.set(dict["sdlora"] if ("sdlora" in dict and dict["sdlora"]) else "")
sd_loramult_var.set(str(dict["sdloramult"]) if ("sdloramult" in dict and dict["sdloramult"]) else "1.0")
whisper_model_var.set(dict["whispermodel"] if ("whispermodel" in dict and dict["whispermodel"]) else "")
def save_config():
file_type = [("KoboldCpp Settings", "*.kcpps")]
filename = asksaveasfile(filetypes=file_type, defaultextension=file_type)
@ -2636,7 +2647,6 @@ def show_new_gui():
if nextstate==0:
exitcounter = 999
print("Exiting by user request.")
time.sleep(1)
sys.exit(0)
else:
# processing vars