mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2025-09-11 01:24:36 +00:00
export image model version when loading
This commit is contained in:
parent
2a21635535
commit
fa65b23de3
5 changed files with 46 additions and 8 deletions
12
koboldcpp.py
12
koboldcpp.py
|
@ -66,6 +66,7 @@ using_gui_launcher = False
|
|||
handle = None
|
||||
friendlymodelname = "inactive"
|
||||
friendlysdmodelname = "inactive"
|
||||
sdmodelversion = ""
|
||||
friendlyembeddingsmodelname = "inactive"
|
||||
lastgeneratedcomfyimg = b''
|
||||
fullsdmodelpath = "" #if empty, it's not initialized
|
||||
|
@ -278,6 +279,10 @@ class sd_load_model_inputs(ctypes.Structure):
|
|||
("quiet", ctypes.c_bool),
|
||||
("debugmode", ctypes.c_int)]
|
||||
|
||||
class sd_load_model_outputs(ctypes.Structure):
|
||||
_fields_ = [("status", ctypes.c_int),
|
||||
("model_version", ctypes.c_char_p)]
|
||||
|
||||
class sd_generation_inputs(ctypes.Structure):
|
||||
_fields_ = [("prompt", ctypes.c_char_p),
|
||||
("negative_prompt", ctypes.c_char_p),
|
||||
|
@ -540,7 +545,7 @@ def init_library():
|
|||
handle.load_state_kv.restype = ctypes.c_bool
|
||||
handle.clear_state_kv.restype = ctypes.c_bool
|
||||
handle.sd_load_model.argtypes = [sd_load_model_inputs]
|
||||
handle.sd_load_model.restype = ctypes.c_bool
|
||||
handle.sd_load_model.restype = sd_load_model_outputs
|
||||
handle.sd_generate.argtypes = [sd_generation_inputs]
|
||||
handle.sd_generate.restype = sd_generation_outputs
|
||||
handle.whisper_load_model.argtypes = [whisper_load_model_inputs]
|
||||
|
@ -6811,11 +6816,14 @@ def kcpp_main_process(launch_args, g_memory=None, gui_launcher=False):
|
|||
friendlysdmodelname = os.path.basename(imgmodel)
|
||||
friendlysdmodelname = os.path.splitext(friendlysdmodelname)[0]
|
||||
friendlysdmodelname = sanitize_string(friendlysdmodelname)
|
||||
loadok = sd_load_model(imgmodel,imgvae,imglora,imgt5xxl,imgclipl,imgclipg)
|
||||
ret = sd_load_model(imgmodel,imgvae,imglora,imgt5xxl,imgclipl,imgclipg)
|
||||
loadok = (ret.status == 0)
|
||||
sdmodelversion = ret.model_version.decode("UTF-8","ignore")
|
||||
print("Load Image Model OK: " + str(loadok))
|
||||
if not loadok:
|
||||
exitcounter = 999
|
||||
exit_with_error(3,"Could not load image model: " + imgmodel)
|
||||
print("Image Model Type: " + sdmodelversion)
|
||||
|
||||
#handle whisper model
|
||||
if args.whispermodel and args.whispermodel!="":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue