mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-07-10 01:18:32 +00:00
adjust max ctx back to 12288, allow img2img with ref images
This commit is contained in:
parent
8c54b65495
commit
18665a574a
2 changed files with 23 additions and 22 deletions
|
|
@ -12,7 +12,7 @@ Current version indicated by LITEVER below.
|
|||
-->
|
||||
<head>
|
||||
<script id="init-config">
|
||||
const LITEVER = 337;
|
||||
const LITEVER = 338;
|
||||
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_";
|
||||
|
|
@ -4518,8 +4518,8 @@ Current version indicated by LITEVER below.
|
|||
second_ep_model:"gpt2",
|
||||
second_ep_url:"",
|
||||
|
||||
max_context_length: (localflag?16384:6144),
|
||||
max_length: (localflag?2048:768),
|
||||
max_context_length: (localflag?12288:6144),
|
||||
max_length: (localflag?1536:768),
|
||||
last_maxctx: 0,
|
||||
auto_ctxlen: true,
|
||||
auto_genamt: true,
|
||||
|
|
@ -14200,17 +14200,12 @@ Current version indicated by LITEVER below.
|
|||
document.getElementById("max_context_length_slide").max = ep_maxctx;
|
||||
document.getElementById("max_context_length_slide_label").innerText = ep_maxctx;
|
||||
}
|
||||
if(ep_maxctx && ep_maxctx>=16384 && document.getElementById("max_length_slide").max<4096)
|
||||
if(ep_maxctx && ep_maxctx>=12288 && document.getElementById("max_length_slide").max < Math.floor(ep_maxctx/4))
|
||||
{
|
||||
document.getElementById("max_length_slide").max = 4096;
|
||||
document.getElementById("max_length_slide_label").innerText = 4096;
|
||||
document.getElementById("max_length_slide").max = Math.floor(ep_maxctx/4);
|
||||
document.getElementById("max_length_slide_label").innerText = Math.floor(ep_maxctx/4);
|
||||
}
|
||||
if(ep_maxctx && ep_maxctx>=32768 && document.getElementById("max_length_slide").max<8192)
|
||||
{
|
||||
document.getElementById("max_length_slide").max = 8192;
|
||||
document.getElementById("max_length_slide_label").innerText = 8192;
|
||||
}
|
||||
if(localflag && ep_maxctx>=16384 && localsettings.max_context_length<ep_maxctx && (localsettings.last_maxctx!=ep_maxctx || localsettings.max_context_length==defaultsettings.max_context_length))
|
||||
if(localflag && ep_maxctx>=12288 && localsettings.max_context_length<ep_maxctx && (localsettings.last_maxctx!=ep_maxctx || localsettings.max_context_length==defaultsettings.max_context_length))
|
||||
{
|
||||
localsettings.max_context_length = ep_maxctx;
|
||||
localsettings.last_maxctx = ep_maxctx;
|
||||
|
|
@ -20056,6 +20051,11 @@ Current version indicated by LITEVER below.
|
|||
maxgenamt = Math.min(curr.max_length,maxgenamt);
|
||||
}
|
||||
}
|
||||
if(localsettings.auto_genamt && localsettings.my_api_key == "0000000000")
|
||||
{
|
||||
//anon horde key limits genamt to 512
|
||||
maxgenamt = Math.min(512,maxgenamt);
|
||||
}
|
||||
}
|
||||
|
||||
let truncated_context = concat_gametext(true, "","","",false,true); //no need to truncate if memory is empty
|
||||
|
|
@ -30000,11 +30000,11 @@ Current version indicated by LITEVER below.
|
|||
<input title="Context Size" inputmode="numeric" class="justifyright push-right" id="max_context_length" style="width: 8ch;" oninput="
|
||||
document.getElementById('max_context_length_slide').value = this.value;">
|
||||
</div>
|
||||
<div><input title="Context Size Slider" type="range" min="512" max="16384" step="8" id="max_context_length_slide" oninput="
|
||||
<div><input title="Context Size Slider" type="range" min="512" max="12288" step="8" id="max_context_length_slide" oninput="
|
||||
document.getElementById('max_context_length').value = this.value;"></div>
|
||||
<div class="settingminmax">
|
||||
<div class="justifyleft">512</div>
|
||||
<div class="justifyright" id="max_context_length_slide_label">16384</div>
|
||||
<div class="justifyright" id="max_context_length_slide_label">12288</div>
|
||||
</div>
|
||||
<div id="auto_ctxlen_panel" class="settinglabel">
|
||||
<div class="justifyleft" title="Automatically lowers settings if incompatible with existing workers">Auto-Adjust Limits </div>
|
||||
|
|
@ -30019,11 +30019,11 @@ Current version indicated by LITEVER below.
|
|||
<input title="Max Output" inputmode="numeric" class="justifyright push-right" id="max_length" oninput="
|
||||
document.getElementById('max_length_slide').value = this.value;">
|
||||
</div>
|
||||
<div><input title="Max Output Slider" type="range" min="16" max="2048" step="2" id="max_length_slide" oninput="
|
||||
<div><input title="Max Output Slider" type="range" min="16" max="1536" step="2" id="max_length_slide" oninput="
|
||||
document.getElementById('max_length').value = this.value;"></div>
|
||||
<div class="settingminmax">
|
||||
<div class="justifyleft">16</div>
|
||||
<div class="justifyright" id="max_length_slide_label">2048</div>
|
||||
<div class="justifyright" id="max_length_slide_label">1536</div>
|
||||
</div>
|
||||
<div id="auto_genamt_panel" class="settinglabel">
|
||||
<div class="justifyleft" title="Automatically lowers settings if incompatible with existing workers">Auto-Adjust Limits </div>
|
||||
|
|
|
|||
13
koboldcpp.py
13
koboldcpp.py
|
|
@ -61,13 +61,14 @@ default_vae_tile_threshold = 640
|
|||
default_sdvaedevice = 'main'
|
||||
default_sdclipdevice = 'CPU'
|
||||
default_native_ctx = 16384
|
||||
default_genlen = 2048
|
||||
default_genlen = 1536
|
||||
overridekv_max = 16
|
||||
default_autofit_padding = 1024
|
||||
lora_filenames_max = 4
|
||||
multiuser_concurrent_limit = 10
|
||||
swa_padding_default = 0
|
||||
default_reqtimeout = 600 # 10 min default
|
||||
default_maxctx = 12288
|
||||
|
||||
# abuse prevention
|
||||
stop_token_max = 256
|
||||
|
|
@ -77,7 +78,7 @@ dry_seq_break_max = 128
|
|||
extra_images_max = 4 # for kontext/qwen img
|
||||
|
||||
# global vars
|
||||
KcppVersion = "1.115.1"
|
||||
KcppVersion = "1.115.2"
|
||||
showdebug = True
|
||||
kcpp_instance = None #global running instance
|
||||
global_memory = {"tunnel_url": "", "restart_target":"", "input_to_exit":False, "load_complete":False, "restart_override_base_config":"", "last_active_timestamp":datetime.now(), "triggered_sleeping":False, "current_model":"initial_model", "base_config":"", "swapReqType": None, "autoswapmode": False}
|
||||
|
|
@ -109,7 +110,7 @@ imglora_bypath = {} # len(imglora_bypath) == 0 <==> static loras
|
|||
imglora_name2path = {}
|
||||
imglora_cached = True
|
||||
imglora_initial_fixed = True
|
||||
maxctx = 16384
|
||||
maxctx = default_maxctx
|
||||
maxhordectx = 0 #set to whatever maxctx is if 0
|
||||
maxhordelen = 1024
|
||||
modelbusy = threading.Lock()
|
||||
|
|
@ -8568,7 +8569,7 @@ def show_gui():
|
|||
makecheckbox(quick_tab, name, properties[0], int(idx/2) + 20, idx % 2, tooltiptxt=properties[1])
|
||||
|
||||
# context size
|
||||
makeslider(quick_tab, "Context Size:", contextsize_text, context_var, 40, width=280, set=17, tooltip="What is the maximum context size to support. Model specific. You cannot exceed it.\nLarger contexts require more memory, and not all models support it.")
|
||||
makeslider(quick_tab, "Context Size:", contextsize_text, context_var, 40, width=280, set=13, tooltip="What is the maximum context size to support. Model specific. You cannot exceed it.\nLarger contexts require more memory, and not all models support it.")
|
||||
|
||||
# load model
|
||||
makefileentry(quick_tab, "GGUF Text Model:", "Select GGUF or GGML Model File", model_var, 50, 280, onchoosefile=on_picked_model_file,tooltiptxt="Select a GGUF or GGML model file on disk to be loaded.")
|
||||
|
|
@ -8645,7 +8646,7 @@ def show_gui():
|
|||
makelabelentry(context_tab, "CacheSlots:", smartcacheslots_var, row=5, padx=(300), singleline=True, tooltip="Number of slots for smartcache",labelpadx=(220))
|
||||
|
||||
# context size
|
||||
makeslider(context_tab, "Context Size:",contextsize_text, context_var, 18, width=280, set=17,tooltip="What is the maximum context size to support. Model specific. You cannot exceed it.\nLarger contexts require more memory, and not all models support it.")
|
||||
makeslider(context_tab, "Context Size:",contextsize_text, context_var, 18, width=280, set=13,tooltip="What is the maximum context size to support. Model specific. You cannot exceed it.\nLarger contexts require more memory, and not all models support it.")
|
||||
context_var.trace_add("write", changed_gpulayers_estimate)
|
||||
makelabelentry(context_tab, "Default Gen Amt:", defaultgenamt_var, row=20, padx=(120), singleline=True, tooltip="How many tokens to generate by default, if not specified. Must be smaller than context size. Usually, your frontend GUI will override this.")
|
||||
makelabelentry(context_tab, "Prompt Limit:", genlimit_var, row=20, padx=(300), singleline=True, tooltip="If set, restricts max output tokens to this limit regardless of API request. Set to 0 to disable.",labelpadx=(210))
|
||||
|
|
@ -12020,7 +12021,7 @@ if __name__ == '__main__':
|
|||
modelgroup.add_argument("--model","-m", metavar=('[filenames]'), help="Model file to load. Accepts multiple values if they are URLs.", type=str, nargs='+', default=[])
|
||||
modelgroup.add_argument("model_param", help="Model file to load (positional)", nargs="?")
|
||||
parser.add_argument("--config", metavar=('[filename]'), help="Load settings from a .kcpps file. Other arguments will be ignored", type=str, nargs=1)
|
||||
parser.add_argument("--contextsize","--ctx-size", "-c", help="Controls the memory allocated for maximum context size, only change if you need more RAM for big contexts. (default 16384).",metavar=('[256 to 262144]'), type=check_range(int,256,262144), default=16384)
|
||||
parser.add_argument("--contextsize","--ctx-size", "-c", help=f"Controls the memory allocated for maximum context size, only change if you need more RAM for big contexts. (default {default_maxctx}).",metavar=('[256 to 262144]'), type=check_range(int,256,262144), default=default_maxctx)
|
||||
parser.add_argument("--gpulayers","--gpu-layers","--n-gpu-layers","-ngl", help="Set number of layers to offload to GPU (when using GPU). Set to -1 to enable autofit (default), set to 0 to disable GPU offload.",metavar=('[GPU layers]'), nargs='?', const=1, type=int, default=-1)
|
||||
parser.add_argument("--host", metavar=('[ipaddr]'), help="Host IP to listen on. If this flag is not set, all routable interfaces are accepted.", default="")
|
||||
parser.add_argument("--launch", help="Launches a web browser when load is completed.", action='store_true')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue