Skip to content

Commit 1a1055e

Browse files
author
prima
committed
fix: Fixes for reloading, attempt to make describe / analyse image more consistent, increased the width of the memory container to 90
1 parent 57f17c3 commit 1a1055e

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

klite.embd

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39126,16 +39126,16 @@ class MarkdownWYSIWYG {
3912639126
}
3912739127
},
3912839128
{
39129-
"name": "analyse_image",
39130-
"description": "Produces a description about an image using AI based on a prompt and an input image. Will prompt the user to select an image to analyse. It does not provide the original prompt used to generate the image.",
39129+
"name": "describe_image",
39130+
"description": "Describes a user provided image. It does not provide the original prompt used to generate the image.",
3913139131
"args": {
39132-
"prompt": "<prompt to query image about>"
39132+
"question": "<question to ask about image>"
3913339133
},
3913439134
"enabled": is_using_kcpp_with_llava(), // Only enabled if local endpoint exists / is in use
3913539135
"executor": async (action) => {
3913639136
let analysisPrompt = "Describe the image in detail. Transcribe and include any text from the image in the description."
39137-
if (!!action?.args?.prompt) {
39138-
analysisPrompt += `Specifically please focus on:\n\n${action?.args?.prompt}`
39137+
if (!!action?.args?.question) {
39138+
analysisPrompt += `Specifically please focus on:\n\n${action?.args?.question}`
3913939139
}
3914039140
if (!!analysisPrompt) {
3914139141
waitingFori2iSelection = true
@@ -40337,7 +40337,7 @@ let checkFinalThoughtsPrompt = `Action: {"command":{"name":"thought","args":{"me
4033740337
let promptOverview = currentOrderOfActionDescriptionsOverall.length > 0 ? currentOrderOfActionDescriptionsOverall[i - 1] : null
4033840338
if (i === 0)
4033940339
{
40340-
let planningPrompt = "The last action from the user is the instruction. If you need to ask the user for a response, the action ask_user must be used and be put as the final action in the order. Produces a list of actions to respond to this instruction."
40340+
let planningPrompt = "The last action from the user is the instruction. If you need to ask the user for a response, the action ask_user must be used and be put as the final action in the order. When handling images always use actions to get information when needed especially for descriptions. Produces a list of actions to respond to this instruction."
4034140341
if (localsettings.inject_chatnames_instruct) {
4034240342
planningPrompt += ` You must respond as ${localsettings.chatopponent.split("||$||").join(" or ")} when using the send_message or ask_user actions. Choose the person based on the user's instruction.`
4034340343
}
@@ -41806,4 +41806,9 @@ flowchart TD\n${treeToViewOutput.outputText.trim()}`
4180641806
}
4180741807
}, 1000)
4180841808
</script>
41809+
<style>
41810+
#memorycontainerfg {
41811+
width: 90%
41812+
}
41813+
</style>
4180941814
</html>

koboldcpp.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7465,6 +7465,7 @@ def main(launch_args, default_args):
74657465
kcpp_instance.daemon = True
74667466
kcpp_instance.start()
74677467
global_memory["restart_target"] = ""
7468+
global_memory["restart_model"] = ""
74687469
time.sleep(3)
74697470
else:
74707471
break # kill the program
@@ -7491,6 +7492,16 @@ def main(launch_args, default_args):
74917492
kcpp_instance = None
74927493
print("Restarting KoboldCpp...")
74937494
fault_recovery_mode = True
7495+
if restart_target=="unload_model":
7496+
reload_from_new_args(vars(default_args))
7497+
args.model_param = None
7498+
args.model = None
7499+
args.nomodel = True
7500+
elif targetfilepath.endswith(".gguf"):
7501+
reload_from_new_args(vars(default_args))
7502+
args.model_param = targetfilepath
7503+
else:
7504+
reload_new_config(targetfilepath)
74947505

74957506
args.currentConfig = targetfilepath
74967507
global_memory["currentConfig"] = targetfilepath

0 commit comments

Comments
 (0)