This commit is contained in:
Saifeddine ALOUI 2024-05-31 01:33:34 +02:00
parent 4eaad8e5e9
commit 84fddf9d3d
11 changed files with 512 additions and 310 deletions

View File

@ -1,5 +1,5 @@
# =================== Lord Of Large Language Multimodal Systems Configuration file ===========================
version: 106
version: 108
binding_name: null
model_name: null
model_variant: null
@ -31,7 +31,17 @@ app_custom_logo: ""
discussion_prompt_separator: "!@>"
start_header_id_template: "!@>"
end_header_id_template: ": "
separator_template: "\n"
start_user_header_id_template: "!@>"
end_user_header_id_template: ": "
end_user_message_id_template: ""
start_ai_header_id_template: "!@>"
end_ai_header_id_template: ": "
end_ai_message_id_template: ""
system_message_template: "system"
seed: -1
@ -156,6 +166,10 @@ openai_tts_voice: "alloy"
enable_sd_service: false
sd_base_url: http://localhost:7860
# Image generation service
enable_fooocus_service: false
fooocus_base_url: http://localhost:7860
# diffuser
diffusers_offloading_mode: sequential_cpu_offload # sequential_cpu_offload
diffusers_model: PixArt-alpha/PixArt-Sigma-XL-2-1024-MS

@ -1 +1 @@
Subproject commit 3a2bc02c1cd537069d83e9aafeaa506f82e01b1b
Subproject commit 8b833fb615331e5728c6ae4bd2ddfb84fce4e335

View File

@ -72,7 +72,7 @@ def terminate_thread(thread):
else:
ASCIIColors.yellow("Canceled successfully")# The current version of the webui
lollms_webui_version="9.8 (γ)"
lollms_webui_version="9.8 (δ)"
@ -962,7 +962,8 @@ class LOLLMSWebUI(LOLLMSElfServer):
if not client.discussion:
return
#fix halucination
client.generated_text=client.generated_text.split(f"{start_header_id_template}")[0]
if len(client.generated_text)>0 and len(start_header_id_template)>0:
client.generated_text=client.generated_text.split(f"{start_header_id_template}")[0]
# Send final message
client.discussion.current_message.finished_generating_at=datetime.now().strftime('%Y-%m-%d %H:%M:%S')
try:

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
View File

@ -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-9cc63556.js"></script>
<link rel="stylesheet" href="/assets/index-dd02af76.css">
<script type="module" crossorigin src="/assets/index-7a762a54.js"></script>
<link rel="stylesheet" href="/assets/index-eda686ad.css">
</head>
<body>
<div id="app"></div>

View File

@ -130,14 +130,14 @@
</div>
<div class="w-fit group relative" v-if="!loading" >
<!-- :onShowPersList="onShowPersListFun" -->
<div class= " inline-flex absolute opacity-0 group-hover:opacity-100 transform group-hover:-translate-y-12 group-hover:translate-x-15 transition-all duration-300" style="pointer-events: none;">
<div class="w-full hover:scale-150"
<div class= "group space-x-1 w-full inline-flex absolute opacity-0 group-hover:opacity-100 transform group-hover:-translate-y-12 group-hover:translate-x-15 transition-all duration-300">
<div class="w-full"
v-for="(item, index) in installedBindings" :key="index + '-' + item.name"
ref="installedBindings">
<div v-if="item.name!=binding_name" class="group items-center flex flex-row">
<button @click.prevent="setBinding(item)" class="w-10 h-10">
<button @click.prevent="setBinding(item)" class="w-8 h-8">
<img :src="item.icon?item.icon:modelImgPlaceholder"
class="z-50 w-10 h-10 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:border-secondary "
class="z-50 w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:border-secondary "
:title="item.name">
</button>
</div>
@ -154,14 +154,14 @@
</div>
<div class="w-fit group relative" v-if="!loading" >
<!-- :onShowPersList="onShowPersListFun" -->
<div class= "group w-full inline-flex absolute opacity-0 group-hover:opacity-100 transform group-hover:-translate-y-12 group-hover:translate-x-15 transition-all duration-300">
<div class= "group space-x-1 w-full inline-flex absolute opacity-0 group-hover:opacity-100 transform group-hover:-translate-y-12 group-hover:translate-x-15 transition-all duration-300">
<div class="w-full"
v-for="(item, index) in installedModels" :key="index + '-' + item.name"
ref="installedModels">
<div v-if="item.name!=model_name" class="group items-center flex flex-row">
<button @click.prevent="setModel(item)" class="w-10 h-10">
<button @click.prevent="setModel(item)" class="w-8 h-8">
<img :src="item.icon?item.icon:modelImgPlaceholder"
class="z-50 w-10 h-10 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:border-secondary "
class="z-50 w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:border-secondary "
:title="item.name">
</button>
</div>
@ -176,7 +176,7 @@
</div>
</div>
<div class="w-fit group relative" >
<div class="w-fit group relative" v-if="!loading">
<!-- :onShowPersList="onShowPersListFun" -->
<div class= "hide .group-hover:block fixed w-[1000px] bottom-0 group absolute opacity-0 group-hover:opacity-100 transform group-hover:translate-y-[-50px] group-hover:translate-x-[0px] transition-all duration-300">
<div class="w-fit flex-wrap flex">

View File

@ -8,7 +8,7 @@
class="w-8 h-8 rounded-full object-fill text-red-700 hover:scale-150 active:scale-90 hover:z-50 hover:-translate-y-2 duration-150 border-secondary cursor-pointer"
:title="'Active personality: '+mountedPers.name" @click="onSettingsPersonality(mountedPers)">
<div class="opacity-0 group-hover:opacity-100">
<button class="-top-1 group-hover:translate-x-5 border-gray-500 absolute active:scale-90 w-7 h-7 hover:scale-150 transition bg-bg-light dark:bg-bg-dark rounded-full border-2" @click.prevent="remount_personality()" v-if="personalityHoveredIndex === index">
<button class="z-50 -top-1 group-hover:translate-x-5 border-gray-500 absolute active:scale-90 w-7 h-7 hover:scale-150 transition bg-bg-light dark:bg-bg-dark rounded-full border-2" @click.prevent="remount_personality()" v-if="personalityHoveredIndex === index">
<span
title="Remount">
<!-- UNMOUNT BUTTON -->
@ -33,14 +33,12 @@
</span>
</button>
<div class="top-0 group-hover:-translate-x-8 group-hover:-translate-y-8 left-0 border-gray-500 active:scale-90 absolute items-center w-7 h-7 hover:scale-150 transition text-red-500 absolute active:scale-90 bg-bg-light dark:bg-bg-dark rounded-full border-2"
@click.stop="toggleShowPersList" title="Click to show more">+{{ mountedPersArr.length - 1 }}</div>
</div>
</div>
</div>
<div class="flex -space-x-4 " v-if="mountedPersArr.length > 1">
<div class="flex items-center justify-center w-8 h-8 cursor-pointer text-xs font-medium bg-bg-light dark:bg-bg-dark border-2 hover:border-secondary rounded-full hover:bg-bg-light-tone dark:hover:bg-bg-dark-tone dark:border-gray-800 hover:z-50 hover:-translate-y-2 duration-150 active:scale-90"
@click.stop="toggleShowPersList" title="Click to show more">+{{ mountedPersArr.length - 1 }}</div>
</div>
</div>
<UniversalForm ref="universalForm" class="z-50" />
</template>

View File

@ -239,67 +239,8 @@
<i data-feather="x"></i>
</button>
</td>
</tr>
<tr>
<td style="min-width: 200px;">
<label for="start_header_id_template" class="text-sm font-bold" style="margin-right: 1rem;">Start header id template:</label>
</td>
<td>
<input
type="text"
id="start_header_id_template"
required
v-model="configFile.start_header_id_template"
@change="settingsChanged=true"
class="w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"
>
</td>
</tr>
<tr>
<td style="min-width: 200px;">
<label for="end_header_id_template" class="text-sm font-bold" style="margin-right: 1rem;">End header id template:</label>
</td>
<td>
<input
type="text"
id="end_header_id_template"
required
v-model="configFile.end_header_id_template"
@change="settingsChanged=true"
class="w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"
>
</td>
</tr>
<tr>
<td style="min-width: 200px;">
<label for="separator_template" class="text-sm font-bold" style="margin-right: 1rem;">Separator template:</label>
</td>
<td>
<textarea
id="separator_template"
required
v-model="configFile.separator_template"
@change="settingsChanged=true"
class="min-h-[500px] 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="system_message_template" class="text-sm font-bold" style="margin-right: 1rem;">System template:</label>
</td>
<td>
<input
type="text"
id="system_message_template"
required
v-model="configFile.system_message_template"
@change="settingsChanged=true"
class="w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"
>
</td>
</tr>
</tr>
<tr>
<td style="min-width: 200px;">
<label for="hardware_mode" class="text-sm font-bold" style="margin-right: 1rem;">Hardware mode:</label>
@ -482,6 +423,187 @@
</tr>
</table>
</Card>
<Card title="Model template" :is_subcard="true" class="pb-2 m-2">
<table class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500">
<tr>
<td style="min-width: 200px;">
<label for="start_header_id_template" class="text-sm font-bold" style="margin-right: 1rem;">Start header id template:</label>
</td>
<td>
<select @change="handleTemplateSelection">
<option value="lollms">Lollms communication template</option>
<option value="lollms_simplified">Lollms simplified communication template</option>
<option value="llama3">LLama3 communication template</option>
<option value="mistral">Mistral communication template</option>
</select>
</td>
</tr>
<tr>
<td style="min-width: 200px;">
<label for="start_header_id_template" class="text-sm font-bold" style="margin-right: 1rem;">Start header id template:</label>
</td>
<td>
<input
type="text"
id="start_header_id_template"
required
v-model="configFile.start_header_id_template"
@change="settingsChanged=true"
class="w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"
>
</td>
</tr>
<tr>
<td style="min-width: 200px;">
<label for="end_header_id_template" class="text-sm font-bold" style="margin-right: 1rem;">End header id template:</label>
</td>
<td>
<input
type="text"
id="end_header_id_template"
required
v-model="configFile.end_header_id_template"
@change="settingsChanged=true"
class="w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"
>
</td>
</tr>
<tr>
<td style="min-width: 200px;">
<label for="start_user_header_id_template" class="text-sm font-bold" style="margin-right: 1rem;">Start user header id template:</label>
</td>
<td>
<input
type="text"
id="start_user_header_id_template"
required
v-model="configFile.start_user_header_id_template"
@change="settingsChanged=true"
class="w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"
>
</td>
</tr>
<tr>
<td style="min-width: 200px;">
<label for="end_user_header_id_template" class="text-sm font-bold" style="margin-right: 1rem;">End user header id template:</label>
</td>
<td>
<input
type="text"
id="end_user_header_id_template"
required
v-model="configFile.end_user_header_id_template"
@change="settingsChanged=true"
class="w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"
>
</td>
</tr>
<tr>
<td style="min-width: 200px;">
<label for="end_user_message_id_template" class="text-sm font-bold" style="margin-right: 1rem;">End user message id template:</label>
</td>
<td>
<input
type="text"
id="end_user_message_id_template"
required
v-model="configFile.end_user_message_id_template"
@change="settingsChanged=true"
class="w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"
>
</td>
</tr>
<tr>
<td style="min-width: 200px;">
<label for="start_ai_header_id_template" class="text-sm font-bold" style="margin-right: 1rem;">Start ai header id template:</label>
</td>
<td>
<input
type="text"
id="start_ai_header_id_template"
required
v-model="configFile.start_ai_header_id_template"
@change="settingsChanged=true"
class="w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"
>
</td>
</tr>
<tr>
<td style="min-width: 200px;">
<label for="end_ai_header_id_template" class="text-sm font-bold" style="margin-right: 1rem;">End ai header id template:</label>
</td>
<td>
<input
type="text"
id="end_ai_header_id_template"
required
v-model="configFile.end_ai_header_id_template"
@change="settingsChanged=true"
class="w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"
>
</td>
</tr>
<tr>
<td style="min-width: 200px;">
<label for="end_ai_message_id_template" class="text-sm font-bold" style="margin-right: 1rem;">End ai message id template:</label>
</td>
<td>
<input
type="text"
id="end_ai_message_id_template"
required
v-model="configFile.end_ai_message_id_template"
@change="settingsChanged=true"
class="w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"
>
</td>
</tr>
<tr>
<td style="min-width: 200px;">
<label for="separator_template" class="text-sm font-bold" style="margin-right: 1rem;">Separator template:</label>
</td>
<td>
<textarea
id="separator_template"
required
v-model="configFile.separator_template"
@change="settingsChanged=true"
class="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="system_message_template" class="text-sm font-bold" style="margin-right: 1rem;">System template:</label>
</td>
<td>
<input
type="text"
id="system_message_template"
required
v-model="configFile.system_message_template"
@change="settingsChanged=true"
class="w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"
>
</td>
</tr>
<tr>
<td style="min-width: 200px;">
<label for="full_template" class="text-sm font-bold" style="margin-right: 1rem;">Full template:</label>
</td>
<td>
<div v-html="full_template"></div>
</td>
</tr>
</table>
</Card>
<Card title="User" :is_subcard="true" class="pb-2 m-2">
<table class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500">
<tr>
@ -3664,6 +3786,64 @@ export default {
//refreshHardwareUsage()
},
methods: {
handleTemplateSelection(event) {
console.log("handleTemplateSelection")
const selectedOption = event.target.value;
console.log("handleTemplateSelection: ",selectedOption)
if (selectedOption === 'lollms') {
console.log("Using lollms template")
this.configFile.start_header_id_template = "!@>"
this.configFile.system_message_template = "system"
this.configFile.end_header_id_template = ": "
this.configFile.separator_template = "\n"
this.configFile.start_user_header_id_template = "!@>"
this.configFile.end_user_header_id_template = ": "
this.configFile.end_user_message_id_template = ""
this.configFile.start_ai_header_id_template = "!@>"
this.configFile.end_ai_header_id_template = ": "
this.configFile.end_ai_message_id_template = ""
this.settingsChanged=true
} else if (selectedOption === 'lollms_simplified') {
console.log("Using lollms template")
this.configFile.start_header_id_template = "@>"
this.configFile.system_message_template = "system"
this.configFile.end_header_id_template = ": "
this.configFile.separator_template = "\n"
this.configFile.start_user_header_id_template = "@>"
this.configFile.end_user_header_id_template = ": "
this.configFile.end_user_message_id_template = ""
this.configFile.start_ai_header_id_template = "@>"
this.configFile.end_ai_header_id_template = ": "
this.configFile.end_ai_message_id_template = ""
this.settingsChanged=true
} else if (selectedOption === 'llama3') {
console.log("Using llama3 template")
this.configFile.start_header_id_template = "<|start_header_id|>"
this.configFile.system_message_template = "system"
this.configFile.end_header_id_template = "<|end_header_id|>"
this.configFile.separator_template = "<|eot_id|>"
this.configFile.start_user_header_id_template = "<|start_header_id|>"
this.configFile.end_user_header_id_template = "<|end_header_id|>"
this.configFile.end_user_message_id_template = ""
this.configFile.start_ai_header_id_template = "<|start_header_id|>"
this.configFile.end_ai_header_id_template = "<|end_header_id|>"
this.configFile.end_ai_message_id_template = ""
this.settingsChanged=true
} else if (selectedOption === 'mistral') {
console.log("Using mistral template")
this.configFile.start_header_id_template = "[INST]"
this.configFile.system_message_template = " Using this information"
this.configFile.end_header_id_template = ": "
this.configFile.separator_template = "\n"
this.configFile.start_user_header_id_template = "[INST]"
this.configFile.end_user_header_id_template = ": "
this.configFile.end_user_message_id_template = "[/INST]"
this.configFile.start_ai_header_id_template = "[INST]"
this.configFile.end_ai_header_id_template = ": "
this.configFile.end_ai_message_id_template = "[/INST]"
this.settingsChanged=true
}
},
install_model(){
},
@ -5544,6 +5724,11 @@ export default {
//this.load_everything()
},
computed: {
full_template:{
get(){
return (this.configFile.start_header_id_template+this.configFile.system_message_template+this.configFile.end_header_id_template+" system message"+this.configFile.separator_template+this.configFile.start_user_header_id_template+"user name"+this.configFile.end_user_header_id_template+" User prompt"+this.configFile.separator_template+this.configFile.end_user_message_id_template+this.configFile.separator_template+this.configFile.start_ai_header_id_template+"ai personality"+this.configFile.end_ai_header_id_template+"ai response"+this.configFile.end_ai_message_id_template).replace("\n","<br>")
}
},
rendered_models_zoo:{
get(){
if (this.searchModel){

@ -1 +1 @@
Subproject commit 2e17c0d61d64a0158651b868c9a7aed2c5c99219
Subproject commit 47651053aed638df45a83f77c64811f8c7106900

@ -1 +1 @@
Subproject commit d62e6c7d0a6ee252d3d5f5c66cce1adc4dcb57b4
Subproject commit 536913543d55a1236ad9555c12770f4c96cee88c