Skip to content

Commit 5f6c480

Browse files
author
prima
committed
Merge remote-tracking branch 'origin/concedo_experimental' into remoteManagement
2 parents f22ee23 + 6039791 commit 5f6c480

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
@@ -66,7 +66,7 @@
6666
dry_seq_break_max = 128
6767

6868
# global vars
69-
KcppVersion = "1.94"
69+
KcppVersion = "1.94.1"
7070
showdebug = True
7171
kcpp_instance = None #global running instance
7272
global_memory = {"tunnel_url": "", "restart_target":"", "input_to_exit":False, "load_complete":False, "restart_model": "", "currentConfig": None, "modelOverride": None, "currentModel": None}
@@ -914,6 +914,26 @@ def read_data(datatype):
914914
str_val = val_bytes.split(b'\0', 1)[0].decode('utf-8')
915915
fptr += str_len
916916
return str_val
917+
if datatype == "u16":
918+
val_bytes = data[fptr:fptr + 2]
919+
val = struct.unpack('<H', val_bytes)[0]
920+
fptr += 2
921+
return val
922+
if datatype == "i16":
923+
val_bytes = data[fptr:fptr + 2]
924+
val = struct.unpack('<h', val_bytes)[0]
925+
fptr += 2
926+
return val
927+
if datatype == "u8":
928+
val_bytes = data[fptr:fptr + 1]
929+
val = struct.unpack('<B', val_bytes)[0]
930+
fptr += 1
931+
return val
932+
if datatype == "i8":
933+
val_bytes = data[fptr:fptr + 1]
934+
val = struct.unpack('<b', val_bytes)[0]
935+
fptr += 1
936+
return val
917937
if datatype=="arr":
918938
val_bytes = data[fptr:fptr + 4]
919939
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)