mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-05-19 16:31:59 +00:00
don't mandate mistral common for other model usage
This commit is contained in:
parent
dd0bf706a3
commit
c8686a627e
3 changed files with 18 additions and 14 deletions
|
|
@ -29,12 +29,15 @@ if 'NO_LOCAL_GGUF' not in os.environ:
|
|||
sys.path.insert(1, str(Path(__file__).parent / 'gguf-py'))
|
||||
import gguf
|
||||
from gguf.vocab import MistralTokenizerType, MistralVocab
|
||||
from mistral_common.tokens.tokenizers.base import TokenizerVersion
|
||||
from mistral_common.tokens.tokenizers.multimodal import DATASET_MEAN, DATASET_STD
|
||||
from mistral_common.tokens.tokenizers.tekken import Tekkenizer
|
||||
from mistral_common.tokens.tokenizers.sentencepiece import (
|
||||
SentencePieceTokenizer,
|
||||
)
|
||||
try:
|
||||
from mistral_common.tokens.tokenizers.base import TokenizerVersion
|
||||
from mistral_common.tokens.tokenizers.multimodal import DATASET_MEAN, DATASET_STD
|
||||
from mistral_common.tokens.tokenizers.tekken import Tekkenizer
|
||||
from mistral_common.tokens.tokenizers.sentencepiece import (
|
||||
SentencePieceTokenizer,
|
||||
)
|
||||
except Exception:
|
||||
print("Warning: No Mistral Common Installed. You cannot convert Mistral models.")
|
||||
|
||||
|
||||
logger = logging.getLogger("hf-to-gguf")
|
||||
|
|
|
|||
15
klite.embd
15
klite.embd
|
|
@ -12,7 +12,7 @@ Current version indicated by LITEVER below.
|
|||
-->
|
||||
|
||||
<script id="init-config">
|
||||
const LITEVER = 284;
|
||||
const LITEVER = 285;
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
var localflag = urlParams.get('local'); //this will be replaced automatically in embedded kcpp
|
||||
const STORAGE_PREFIX = (localflag?"e_":"")+"kaihordewebui_";
|
||||
|
|
@ -4142,12 +4142,11 @@ Current version indicated by LITEVER below.
|
|||
{
|
||||
return !isNaN(parseFloat(n)) && isFinite(n);
|
||||
}
|
||||
function escapeRegExp(string) {
|
||||
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
|
||||
}
|
||||
function replaceAll(str, find, replace, caseInsensitive=false) //replace all occurances in string with string
|
||||
{
|
||||
function escapeRegExp(string) {
|
||||
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
|
||||
}
|
||||
|
||||
return str.replace(new RegExp(escapeRegExp(find), (caseInsensitive?'gi':'g')), replace);
|
||||
}
|
||||
function rgb_to_hex(rgbColor) { //convert rgb color to hex
|
||||
|
|
@ -4939,7 +4938,9 @@ Current version indicated by LITEVER below.
|
|||
{
|
||||
return "";
|
||||
}
|
||||
return `${localsettings.start_thinking_tag}([\\s\\S]*?)${localsettings.stop_thinking_tag}`;
|
||||
const safeStart = escapeRegExp(localsettings.start_thinking_tag);
|
||||
const safeStop = escapeRegExp(localsettings.stop_thinking_tag);
|
||||
return `${safeStart}([\\s\\S]*?)${safeStop}`;
|
||||
}
|
||||
|
||||
function remove_all_instruct_tags(text)
|
||||
|
|
@ -15135,7 +15136,7 @@ Current version indicated by LITEVER below.
|
|||
let matchiter = 0;
|
||||
inputtxt = inputtxt.replace(/%ExpandBtn%(?:\n{0,2})?/g, function (m) {
|
||||
let curr = matches[matchiter];
|
||||
let expandedhtml = `<span><button type="button" title="Show Thoughts" class="btn btn-primary" style="font-size:12px;padding:2px 2px;" onclick="toggle_hide_thinking(this)">Show Thoughts (${curr.length} characters)</button><span class="color_lightgreen hidden"><br>${escape_html(curr)}</span><br></span>`;
|
||||
let expandedhtml = `<span><button type="button" title="Show Thoughts" class="btn btn-primary" style="font-size:12px;padding:2px 2px;" onclick="toggle_hide_thinking(this)">Show Thoughts (${curr.length} characters)</button><span class="color_lightgreen hidden"><br>${escape_html(curr)}\n</span><br></span>`;
|
||||
if(!curr || curr.trim()=="" || curr.trim()=="/nothink" || curr.trim()==`${localsettings.start_thinking_tag}${localsettings.stop_thinking_tag}`)
|
||||
{
|
||||
expandedhtml = `<span><button type="button" title="No Thoughts" class="btn btn-primary" style="font-size:12px;padding:2px 2px;" onclick="">No Thoughts</button><br></span>`;
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ dry_seq_break_max = 128
|
|||
extra_images_max = 4
|
||||
|
||||
# global vars
|
||||
KcppVersion = "1.99"
|
||||
KcppVersion = "1.99.1"
|
||||
showdebug = True
|
||||
kcpp_instance = None #global running instance
|
||||
global_memory = {"tunnel_url": "", "restart_target":"", "input_to_exit":False, "load_complete":False, "restart_override_config_target":""}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue