Skip to content

Commit 6039791

Browse files
committed
minor bugfixes
1 parent 45f589b commit 6039791

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

koboldcpp.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
dry_seq_break_max = 128
6262

6363
# global vars
64-
KcppVersion = "1.94"
64+
KcppVersion = "1.94.1"
6565
showdebug = True
6666
kcpp_instance = None #global running instance
6767
global_memory = {"tunnel_url": "", "restart_target":"", "input_to_exit":False, "load_complete":False, "restart_override_config_target":""}
@@ -899,6 +899,26 @@ def read_data(datatype):
899899
str_val = val_bytes.split(b'\0', 1)[0].decode('utf-8')
900900
fptr += str_len
901901
return str_val
902+
if datatype == "u16":
903+
val_bytes = data[fptr:fptr + 2]
904+
val = struct.unpack('<H', val_bytes)[0]
905+
fptr += 2
906+
return val
907+
if datatype == "i16":
908+
val_bytes = data[fptr:fptr + 2]
909+
val = struct.unpack('<h', val_bytes)[0]
910+
fptr += 2
911+
return val
912+
if datatype == "u8":
913+
val_bytes = data[fptr:fptr + 1]
914+
val = struct.unpack('<B', val_bytes)[0]
915+
fptr += 1
916+
return val
917+
if datatype == "i8":
918+
val_bytes = data[fptr:fptr + 1]
919+
val = struct.unpack('<b', val_bytes)[0]
920+
fptr += 1
921+
return val
902922
if datatype=="arr":
903923
val_bytes = data[fptr:fptr + 4]
904924
arr_type = struct.unpack('<I', val_bytes)[0]

otherarch/sdcpp/sdtype_adapter.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,9 @@ sd_generation_outputs sdtype_generate(const sd_generation_inputs inputs)
589589
//ensure prompt has img keyword, otherwise append it
590590
if (sd_params->prompt.find("img") == std::string::npos) {
591591
sd_params->prompt += " img";
592+
} else if (sd_params->prompt.rfind("img", 0) == 0) {
593+
// "img" found at the start of the string (position 0), which is not allowed. Add some text before it
594+
sd_params->prompt = "person " + sd_params->prompt;
592595
}
593596
}
594597

0 commit comments

Comments
 (0)