From 0fd85c3940031a379b88d493201f838f452daa27 Mon Sep 17 00:00:00 2001 From: Concedo <39025047+LostRuins@users.noreply.github.com> Date: Fri, 13 Sep 2024 15:51:59 +0800 Subject: [PATCH] updated lite --- klite.embd | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/klite.embd b/klite.embd index ca25d8e81..2f317d0c0 100644 --- a/klite.embd +++ b/klite.embd @@ -4002,13 +4002,17 @@ Current version indicated by LITEVER below. .replace(/(^\d\d?[ .] .*)\%SpcStg\%/gm, "$1\n\%SpcTemp\%") //fix misalign .replace(/^\d\d?[ .] (.*)([\n]??)/gm, "
  1. $1
") .replace(/\n\%SpcTemp\%/gm, "\%SpcStg\%") //fix misalign - .replace(/<\/li><\/ol>
  1. /gm, "
  2. ") + .replace(/<\/li><\/ol>\n\s*?\n
    1. /gm, "
    2. \n
    3. ") + .replace(/<\/li><\/ol>\s*?
      1. /gm, "
      2. ") .replace(/<\/[ou]l>
      3. (.*\%SpcStg\%.*\%SpcEtg\%.*)<\/li><\/[ou]l\>/gm,"$1") .replace(/^\s{2,6}[\*+-][ .](.*)/gm, "
          • $1
        ") .replace(/^\s{2,6}\d[ .](.*)/gm, "
          1. $1
        ") - .replace(/<\/[ou]l\>\n\n<[ou]l\>/gm, "\n") - .replace(/<\/[ou]l\>\n<[ou]l\>/g, "") - .replace(/<\/li><\/ul>
        • /gm, "
        • ") + .replace(/<\/ul\>\n\n/gm, "\n") + .replace(/<\/ol\>\n\n/gm, "\n") + .replace(/<\/ol\>\n/g, "") + .replace(/<\/ul\>\n/g, "") + .replace(/<\/li><\/ul>\n\s*?\n
          • /gm, "
          • \n
          • ") + .replace(/<\/li><\/ul>\s*?
            • /gm, "
            • ") .replace(/\*\*\*([^\s*].*?[^\\])\*\*\*/gm, "$1") .replace(/\*\*([^\s*].*?[^\\])\*\*/gm, "$1") .replace(/\*([^\s*].*?[^\\])\*/gm, "$1") @@ -12419,6 +12423,18 @@ Current version indicated by LITEVER below. oai_payload.logit_bias = submit_payload.params.logit_bias; } + let is_using_o1 = custom_oai_model.toLowerCase().startsWith("o1-mini") || custom_oai_model.toLowerCase().startsWith("o1-preview"); + if(is_using_o1) + { + //o1 does not support ANY customization + oai_payload = + { + //remove max tokens due to huge amount needed + //"max_completion_tokens": submit_payload.params.max_length, + "model": custom_oai_model + } + } + if (document.getElementById("useoaichatcompl").checked) { let mainoaibody = submit_payload.prompt; //can be string or array if(insertAIVisionImages.length>0) @@ -17687,6 +17703,8 @@ Current version indicated by LITEVER below. + +