mirror of
https://github.com/ParisNeo/lollms-webui.git
synced 2024-12-18 20:17:50 +00:00
enhanced new version
This commit is contained in:
parent
e547bee9ad
commit
f2de613a1c
@ -1027,7 +1027,9 @@ class LoLLMsAPPI(LollmsApplication):
|
||||
discussion_messages = composed_messages
|
||||
|
||||
|
||||
|
||||
conditionning = self.personality.personality_conditioning
|
||||
if self.config["override_personality_model_parameters"]:
|
||||
conditionning = conditionning+ "!@>user description:\n"+self.config["user_description"]+"\n"
|
||||
|
||||
if len(self.personality.files)>0 and self.personality.vectorizer:
|
||||
pr = PromptReshaper("!@>document chunks:\n{{doc}}\n{{conditionning}}\n{{content}}")
|
||||
@ -1038,13 +1040,13 @@ class LoLLMsAPPI(LollmsApplication):
|
||||
str_docs+=f"document chunk:\nchunk path: {infos[0]}\nchunk content:{doc}"
|
||||
discussion_messages = pr.build({
|
||||
"doc":str_docs,
|
||||
"conditionning":self.personality.personality_conditioning,
|
||||
"conditionning":conditionning,
|
||||
"content":discussion_messages
|
||||
}, self.model.tokenize, self.model.detokenize, self.config.ctx_size, place_holders_to_sacrifice=["content"])
|
||||
else:
|
||||
pr = PromptReshaper("{{conditionning}}\n{{content}}")
|
||||
discussion_messages = pr.build({
|
||||
"conditionning":self.personality.personality_conditioning,
|
||||
"conditionning":conditionning,
|
||||
"content":discussion_messages
|
||||
}, self.model.tokenize, self.model.detokenize, self.config.ctx_size, place_holders_to_sacrifice=["content"])
|
||||
|
||||
@ -1053,6 +1055,9 @@ class LoLLMsAPPI(LollmsApplication):
|
||||
ASCIIColors.yellow(discussion_messages)
|
||||
ASCIIColors.info(f"prompt size:{len(tokens)} tokens")
|
||||
|
||||
|
||||
|
||||
|
||||
return discussion_messages, message.content, tokens
|
||||
|
||||
def get_discussion_to(self, client_id, message_id=-1):
|
||||
|
@ -1,5 +1,5 @@
|
||||
# =================== Lord Of Large Language Models Configuration file ===========================
|
||||
version: 22
|
||||
version: 23
|
||||
binding_name: null
|
||||
model_name: null
|
||||
|
||||
@ -31,6 +31,7 @@ user_name: user
|
||||
user_description: ""
|
||||
use_user_name_in_discussions: false
|
||||
user_avatar: default_user.svg
|
||||
use_user_informations_in_discussion: false
|
||||
|
||||
# UI parameters
|
||||
db_path: database.db
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
4
web/dist/index.html
vendored
4
web/dist/index.html
vendored
@ -6,8 +6,8 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>LoLLMS WebUI - Welcome</title>
|
||||
<script type="module" crossorigin src="/assets/index-7158f20c.js"></script>
|
||||
<link rel="stylesheet" href="/assets/index-7dad82f8.css">
|
||||
<script type="module" crossorigin src="/assets/index-01aa7718.js"></script>
|
||||
<link rel="stylesheet" href="/assets/index-912a1e1a.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
@ -708,7 +708,25 @@
|
||||
class="w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
|
||||
></textarea>
|
||||
</td>
|
||||
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="min-width: 200px;">
|
||||
<label for="user_description" class="text-sm font-bold" style="margin-right: 1rem;">Use user description in discussion:</label>
|
||||
</td>
|
||||
<td style="width: 100%;">
|
||||
<input
|
||||
type="checkbox"
|
||||
id="override_personality_model_parameters"
|
||||
required
|
||||
v-model="configFile.override_personality_model_parameters"
|
||||
@change="settingsChanged=true"
|
||||
class="mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
|
||||
>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<!-- Row 3 -->
|
||||
<tr>
|
||||
@ -2324,7 +2342,11 @@ export default {
|
||||
this.update_model(model_object.model.name).then((res)=>{
|
||||
console.log("update_model",res)
|
||||
this.configFile.model_name = model_object.model.name
|
||||
this.$refs.toast.showToast("Selected model:\n" + model_object.name, 4, true)
|
||||
if(res.status){
|
||||
this.$refs.toast.showToast("Selected model:\n" + model_object.name, 4, true)
|
||||
}else{
|
||||
this.$refs.toast.showToast("Couldn't select model:\n" + model_object.name, 4, false)
|
||||
}
|
||||
this.settingsChanged = true
|
||||
this.isModelSelected = true
|
||||
});
|
||||
@ -2520,17 +2542,9 @@ export default {
|
||||
model_object.uninstalling = false;
|
||||
socket.off('install_progress', progressListener);
|
||||
this.showProgress = false;
|
||||
const index = this.models.findIndex((model) => model.name === model_object.name);
|
||||
this.models[index].isInstalled = false;
|
||||
if (model_object.model.isCustomModel) {
|
||||
try{
|
||||
this.models = this.models.filter((model) => model.name !== model_object.name)
|
||||
}
|
||||
catch{
|
||||
this.models = this.models
|
||||
}
|
||||
}
|
||||
this.$refs.toast.showToast("Model:\n" + model_object.name + "\nwas uninstalled!", 4, true)
|
||||
this.$store.dispatch('refreshModelsZoo');
|
||||
this.modelsFiltered = this.models
|
||||
this.$refs.toast.showToast("Model:\n" + model_object.model.name + "\nwas uninstalled!", 4, true)
|
||||
this.$store.dispatch('refreshDiskUsage');
|
||||
} else {
|
||||
console.log("uninstalling failed", response)
|
||||
@ -2539,8 +2553,8 @@ export default {
|
||||
this.showProgress = false;
|
||||
socket.off('uninstall_progress', progressListener);
|
||||
// eslint-disable-next-line no-undef
|
||||
console.error('Uninstallation failed:', message.error);
|
||||
this.$refs.toast.showToast("Model:\n" + model_object.name + "\nfailed to uninstall!", 4, false)
|
||||
console.error('Uninstallation failed:', response.error);
|
||||
this.$refs.toast.showToast("Model:\n" + model_object.model.name + "\nfailed to uninstall!", 4, false)
|
||||
this.$store.dispatch('refreshDiskUsage');
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user