diff --git a/gpttype_adapter.cpp b/gpttype_adapter.cpp index 8cdb2c63e..b50d340b3 100644 --- a/gpttype_adapter.cpp +++ b/gpttype_adapter.cpp @@ -3468,7 +3468,7 @@ generation_outputs gpttype_generate(const generation_inputs inputs) if (debugmode==1 && !is_quiet) { std::string outstr = ""; - printf("\n\n[Debug: Dump Raw Input Tokens]\n"); + printf("\n\n[Debug: Dump %d Raw Input Tokens]\n",embd_inp.size()); outstr += get_tok_vec_str(embd_inp); printf("%s\n", RemoveBell(outstr).c_str()); } @@ -3615,7 +3615,7 @@ generation_outputs gpttype_generate(const generation_inputs inputs) if (debugmode==1 && !is_quiet) { std::string outstr = ""; - // printf("\n[Debug: Dump Forwarded Input Tokens, format: %d]\n", file_format); + // printf("\n[Debug: Dump Forwarded Input Tokens]\n"); // outstr += get_tok_vec_str(embd_inp); outstr += "\n\n[Debug: n_past="+std::to_string(n_past)+" Context Size = " + std::to_string(current_context_tokens.size()) + "]\n"; outstr += get_tok_vec_str(current_context_tokens); diff --git a/koboldcpp.py b/koboldcpp.py index 27e6c5d6c..05093b8eb 100644 --- a/koboldcpp.py +++ b/koboldcpp.py @@ -4367,6 +4367,9 @@ def show_gui(): def on_picked_model_file(filepath): if filepath and (filepath.lower().endswith('.kcpps') or filepath.lower().endswith('.kcppt')): #load it as a config file instead + if filepath.lower().endswith('.kcpps'): + global runmode_untouched + runmode_untouched = False with open(filepath, 'r', encoding='utf-8', errors='ignore') as f: dict = json.load(f) import_vars(dict) diff --git a/model_adapter.cpp b/model_adapter.cpp index c09352ea9..4ac5c4655 100644 --- a/model_adapter.cpp +++ b/model_adapter.cpp @@ -464,9 +464,10 @@ void print_tok_vec(std::vector &embd) //fast forward the past based on identical tokens, stop once a divergence is noted int embd_inp_len = embd_inp.size(); + int cur_ctx_len = current_context_tokens.size(); bool fastforwardok = true; - for (int i = 0; i < current_context_tokens.size(); ++i) + for (int i = 0; i < cur_ctx_len; ++i) { if (current_context_tokens[i] == embd_inp[i]) { @@ -500,6 +501,10 @@ void print_tok_vec(std::vector &embd) { break; } + if ((i + 2) >= cur_ctx_len) + { + break; + } } }