Skip to content

Commit 7de1ebf

Browse files
authored
Streamline with dictionaries (ggml-org#1005)
* dictionary ggml-org#1 * dictionary ggml-org#2
1 parent ce971a0 commit 7de1ebf

File tree

1 file changed

+24
-20
lines changed

1 file changed

+24
-20
lines changed

koboldcpp.py

+24-20
Original file line numberDiff line numberDiff line change
@@ -2511,15 +2511,18 @@ def changerunmode(a,b,c):
25112511
quick_mmq_box = makecheckbox(quick_tab, "Use QuantMatMul (mmq)", mmq_var, 4,1,tooltiptxt="Enable MMQ mode instead of CuBLAS for prompt processing. Read the wiki. Speed may vary.")
25122512

25132513
# quick boxes
2514-
quick_boxes = {"Launch Browser": launchbrowser , "Disable MMAP":disablemmap,"Use ContextShift":contextshift,"Remote Tunnel":remotetunnel,"Use FlashAttention":flashattention,"Quiet Mode":quietmode}
2515-
quick_boxes_desc = {"Launch Browser": "Launches your default browser after model loading is complete",
2516-
"Disable MMAP":"Avoids using mmap to load models if enabled",
2517-
"Use ContextShift":"Uses Context Shifting to reduce reprocessing.\nRecommended. Check the wiki for more info.",
2518-
"Remote Tunnel":"Creates a trycloudflare tunnel.\nAllows you to access koboldcpp from other devices over an internet URL.",
2519-
"Use FlashAttention":"Enable flash attention for GGUF models.",
2520-
"Quiet Mode":"Prevents all generation related terminal output from being displayed."}
2521-
for idx, name, in enumerate(quick_boxes):
2522-
makecheckbox(quick_tab, name, quick_boxes[name], int(idx/2) +20, idx%2,tooltiptxt=quick_boxes_desc[name])
2514+
quick_boxes = {
2515+
"Launch Browser": {"variable": launchbrowser, "description": "Launches your default browser after model loading is complete"},
2516+
"Disable MMAP": {"variable": disablemmap, "description": "Avoids using mmap to load models if enabled"},
2517+
"Use ContextShift": {"variable": contextshift, "description": "Uses Context Shifting to reduce reprocessing.\nRecommended. Check the wiki for more info."},
2518+
"Remote Tunnel": {"variable": remotetunnel, "description": "Creates a trycloudflare tunnel.\nAllows you to access koboldcpp from other devices over an internet URL."},
2519+
"Use FlashAttention": {"variable": flashattention, "description": "Enable flash attention for GGUF models."},
2520+
"Quiet Mode": {"variable": quietmode, "description": "Prevents all generation related terminal output from being displayed."}
2521+
}
2522+
2523+
for idx, (name, properties) in enumerate(quick_boxes.items()):
2524+
makecheckbox(quick_tab, name, properties["variable"], int(idx/2) + 20, idx % 2, tooltiptxt=properties["description"])
2525+
25232526
# context size
25242527
makeslider(quick_tab, "Context Size:", contextsize_text, context_var, 0, len(contextsize_text)-1, 30, width=280, set=5,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.")
25252528

@@ -2555,17 +2558,18 @@ def changerunmode(a,b,c):
25552558
makelabelentry(hardware_tab, "Threads:" , threads_var, 11, 50,tooltip="How many threads to use.\nRecommended value is your CPU core count, defaults are usually OK.")
25562559

25572560
# hardware checkboxes
2558-
hardware_boxes = {"Launch Browser": launchbrowser, "High Priority" : highpriority, "Disable MMAP":disablemmap, "Use mlock":usemlock, "Debug Mode":debugmode, "Keep Foreground":keepforeground}
2559-
hardware_boxes_desc = {"Launch Browser": "Launches your default browser after model loading is complete",
2560-
"High Priority": "Increases the koboldcpp process priority.\nMay cause lag or slowdown instead. Not recommended.",
2561-
"Disable MMAP": "Avoids using mmap to load models if enabled",
2562-
"Use mlock": "Enables mlock, preventing the RAM used to load the model from being paged out.",
2563-
"Debug Mode": "Enables debug mode, with extra info printed to the terminal.",
2564-
"Keep Foreground": "Bring KoboldCpp to the foreground every time there is a new generation."}
2565-
2566-
for idx, name, in enumerate(hardware_boxes):
2567-
makecheckbox(hardware_tab, name, hardware_boxes[name], int(idx/2) +30, idx%2, tooltiptxt=hardware_boxes_desc[name])
2568-
2561+
hardware_boxes = {
2562+
"Launch Browser": {"variable": launchbrowser, "description": "Launches your default browser after model loading is complete"},
2563+
"High Priority": {"variable": highpriority, "description": "Increases the koboldcpp process priority.\nMay cause lag or slowdown instead. Not recommended."},
2564+
"Disable MMAP": {"variable": disablemmap, "description": "Avoids using mmap to load models if enabled"},
2565+
"Use mlock": {"variable": usemlock, "description": "Enables mlock, preventing the RAM used to load the model from being paged out."},
2566+
"Debug Mode": {"variable": debugmode, "description": "Enables debug mode, with extra info printed to the terminal."},
2567+
"Keep Foreground": {"variable": keepforeground, "description": "Bring KoboldCpp to the foreground every time there is a new generation."}
2568+
}
2569+
2570+
for idx, (name, properties) in enumerate(hardware_boxes.items()):
2571+
makecheckbox(hardware_tab, name, properties["variable"], int(idx/2) + 30, idx % 2, tooltiptxt=properties["description"])
2572+
25692573
# blas thread specifier
25702574
makelabelentry(hardware_tab, "BLAS threads:" , blas_threads_var, 14, 50,tooltip="How many threads to use during BLAS processing.\nIf left blank, uses same value as regular thread count.")
25712575
# blas batch size

0 commit comments

Comments
 (0)