mirror of
https://github.com/ParisNeo/lollms-webui.git
synced 2025-01-29 15:44:12 +00:00
upgraded version
This commit is contained in:
parent
9e81055007
commit
874d497b35
@ -594,7 +594,7 @@ class LoLLMsAPPI(LollmsApplication):
|
||||
self.full_message_list = []
|
||||
for message in messages:
|
||||
if message["id"]< message_id or message_id==-1:
|
||||
if message["type"]==MSG_TYPE.MSG_TYPE_FULL:
|
||||
if message["type"]<=MSG_TYPE.MSG_TYPE_FULL_INVISIBLE_TO_USER.value and message["type"]!=MSG_TYPE.MSG_TYPE_FULL_INVISIBLE_TO_AI.value:
|
||||
if message["sender"]==self.personality.name:
|
||||
self.full_message_list.append(self.personality.ai_message_prefix+message["content"])
|
||||
else:
|
||||
@ -610,9 +610,9 @@ class LoLLMsAPPI(LollmsApplication):
|
||||
|
||||
|
||||
discussion_messages = self.personality.personality_conditioning+ link_text.join(self.full_message_list)
|
||||
|
||||
tokens = self.model.tokenize(discussion_messages)
|
||||
|
||||
return discussion_messages, message["content"]
|
||||
return discussion_messages, message["content"], tokens
|
||||
|
||||
def get_discussion_to(self, message_id=-1):
|
||||
messages = self.current_discussion.get_messages()
|
||||
@ -751,13 +751,13 @@ class LoLLMsAPPI(LollmsApplication):
|
||||
return
|
||||
|
||||
self._generate(full_prompt, n_predict, callback)
|
||||
print("Finished executing the generation")
|
||||
ASCIIColors.success("\nFinished executing the generation")
|
||||
|
||||
def _generate(self, prompt, n_predict=1024, callback=None):
|
||||
self.current_generated_text = ""
|
||||
self.nb_received_tokens = 0
|
||||
if self.model is not None:
|
||||
ASCIIColors.info("warmup")
|
||||
ASCIIColors.info(f"warmup for generating {n_predict} tokens")
|
||||
if self.config["override_personality_model_parameters"]:
|
||||
output = self.model.generate(
|
||||
prompt,
|
||||
@ -830,10 +830,10 @@ class LoLLMsAPPI(LollmsApplication):
|
||||
self.socketio.sleep(0.01)
|
||||
|
||||
# prepare query and reception
|
||||
self.discussion_messages, self.current_message = self.prepare_query(message_id, is_continue)
|
||||
self.discussion_messages, self.current_message, tokens = self.prepare_query(message_id, is_continue)
|
||||
self.prepare_reception()
|
||||
self.generating = True
|
||||
self.generate(self.discussion_messages, self.current_message, n_predict = self.config['n_predict'], callback=self.process_chunk)
|
||||
self.generate(self.discussion_messages, self.current_message, n_predict = self.config.ctx_size-len(tokens)-1, callback=self.process_chunk)
|
||||
print()
|
||||
print("## Done Generation ##")
|
||||
print()
|
||||
|
6
app.py
6
app.py
@ -493,12 +493,6 @@ class LoLLMsWebUI(LoLLMsAPPI):
|
||||
elif setting_name== "language":
|
||||
self.config["language"]=data['setting_value']
|
||||
|
||||
elif setting_name== "personality_language":
|
||||
self.personality_language=data['setting_value']
|
||||
|
||||
elif setting_name== "personality_category":
|
||||
self.personality_category=data['setting_value']
|
||||
|
||||
elif setting_name== "personality_folder":
|
||||
self.personality_name=data['setting_value']
|
||||
if len(self.config["personalities"])>0:
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
||||
.dot{width:10px;height:10px;border-radius:50%}.dot-green{background-color:green}.dot-red{background-color:red}.scrollbar[data-v-3cb88319]{scrollbar-width:thin;scrollbar-color:var(--scrollbar-thumb-color) var(--scrollbar-track-color);white-space:pre-wrap;overflow-wrap:break-word}.scrollbar[data-v-3cb88319]::-webkit-scrollbar{width:8px}.scrollbar[data-v-3cb88319]::-webkit-scrollbar-track{background-color:var(--scrollbar-track-color)}.scrollbar[data-v-3cb88319]::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb-color);border-radius:4px}.scrollbar[data-v-3cb88319]::-webkit-scrollbar-thumb:hover{background-color:var(--scrollbar-thumb-hover-color)}.toastItem-enter-active[data-v-3ffdabf3],.toastItem-leave-active[data-v-3ffdabf3]{transition:all .5s ease}.toastItem-enter-from[data-v-3ffdabf3],.toastItem-leave-to[data-v-3ffdabf3]{opacity:0;transform:translate(-30px)}.list-move[data-v-8059edcb],.list-enter-active[data-v-8059edcb],.list-leave-active[data-v-8059edcb]{transition:all .5s ease}.list-enter-from[data-v-8059edcb]{transform:translatey(-30px)}.list-leave-to[data-v-8059edcb]{opacity:0;transform:translatey(30px)}.list-leave-active[data-v-8059edcb]{position:absolute}.bounce-enter-active[data-v-8059edcb]{animation:bounce-in-8059edcb .5s}.bounce-leave-active[data-v-8059edcb]{animation:bounce-in-8059edcb .5s reverse}@keyframes bounce-in-8059edcb{0%{transform:scale(0)}50%{transform:scale(1.25)}to{transform:scale(1)}}.bg-primary-light[data-v-8059edcb]{background-color:#0ff}.hover[data-v-8059edcb]:bg-primary-light:hover{background-color:#7fffd4}.font-bold[data-v-8059edcb]{font-weight:700}.hljs-comment,.hljs-quote{color:#7285b7}.hljs-deletion,.hljs-name,.hljs-regexp,.hljs-selector-class,.hljs-selector-id,.hljs-tag,.hljs-template-variable,.hljs-variable{color:#ff9da4}.hljs-built_in,.hljs-link,.hljs-literal,.hljs-meta,.hljs-number,.hljs-params,.hljs-type{color:#ffc58f}.hljs-attribute{color:#ffeead}.hljs-addition,.hljs-bullet,.hljs-string,.hljs-symbol{color:#d1f1a9}.hljs-section,.hljs-title{color:#bbdaff}.hljs-keyword,.hljs-selector-tag{color:#ebbbff}.hljs{background:#002451;color:#fff}pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!
|
||||
.dot{width:10px;height:10px;border-radius:50%}.dot-green{background-color:green}.dot-red{background-color:red}.scrollbar[data-v-3cb88319]{scrollbar-width:thin;scrollbar-color:var(--scrollbar-thumb-color) var(--scrollbar-track-color);white-space:pre-wrap;overflow-wrap:break-word}.scrollbar[data-v-3cb88319]::-webkit-scrollbar{width:8px}.scrollbar[data-v-3cb88319]::-webkit-scrollbar-track{background-color:var(--scrollbar-track-color)}.scrollbar[data-v-3cb88319]::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb-color);border-radius:4px}.scrollbar[data-v-3cb88319]::-webkit-scrollbar-thumb:hover{background-color:var(--scrollbar-thumb-hover-color)}.toastItem-enter-active[data-v-3ffdabf3],.toastItem-leave-active[data-v-3ffdabf3]{transition:all .5s ease}.toastItem-enter-from[data-v-3ffdabf3],.toastItem-leave-to[data-v-3ffdabf3]{opacity:0;transform:translate(-30px)}.list-move[data-v-a191c1e8],.list-enter-active[data-v-a191c1e8],.list-leave-active[data-v-a191c1e8]{transition:all .5s ease}.list-enter-from[data-v-a191c1e8]{transform:translatey(-30px)}.list-leave-to[data-v-a191c1e8]{opacity:0;transform:translatey(30px)}.list-leave-active[data-v-a191c1e8]{position:absolute}.bounce-enter-active[data-v-a191c1e8]{animation:bounce-in-a191c1e8 .5s}.bounce-leave-active[data-v-a191c1e8]{animation:bounce-in-a191c1e8 .5s reverse}@keyframes bounce-in-a191c1e8{0%{transform:scale(0)}50%{transform:scale(1.25)}to{transform:scale(1)}}.bg-primary-light[data-v-a191c1e8]{background-color:#0ff}.hover[data-v-a191c1e8]:bg-primary-light:hover{background-color:#7fffd4}.font-bold[data-v-a191c1e8]{font-weight:700}.hljs-comment,.hljs-quote{color:#7285b7}.hljs-deletion,.hljs-name,.hljs-regexp,.hljs-selector-class,.hljs-selector-id,.hljs-tag,.hljs-template-variable,.hljs-variable{color:#ff9da4}.hljs-built_in,.hljs-link,.hljs-literal,.hljs-meta,.hljs-number,.hljs-params,.hljs-type{color:#ffc58f}.hljs-attribute{color:#ffeead}.hljs-addition,.hljs-bullet,.hljs-string,.hljs-symbol{color:#d1f1a9}.hljs-section,.hljs-title{color:#bbdaff}.hljs-keyword,.hljs-selector-tag{color:#ebbbff}.hljs{background:#002451;color:#fff}pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!
|
||||
Theme: Tokyo-night-Dark
|
||||
origin: https://github.com/enkia/tokyo-night-vscode-theme
|
||||
Description: Original highlight.js style
|
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-9cc9b61c.js"></script>
|
||||
<link rel="stylesheet" href="/assets/index-e7b9729e.css">
|
||||
<script type="module" crossorigin src="/assets/index-0016d472.js"></script>
|
||||
<link rel="stylesheet" href="/assets/index-4747dbaa.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
@ -982,7 +982,7 @@
|
||||
<label for="persLang" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">
|
||||
Personalities Languages: ({{ persLangArr.length }})
|
||||
</label>
|
||||
<select id="persLang" @change="update_setting('personality_language', $event.target.value, refresh)"
|
||||
<select id="persLang" @change="update_personality_language($event.target.value, refresh)"
|
||||
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">
|
||||
|
||||
<option v-for="item in persLangArr" :selected="item === this.configFile.personality_language">{{
|
||||
@ -997,7 +997,7 @@
|
||||
<label for="persCat" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">
|
||||
Personalities Category: ({{ persCatgArr.length }})
|
||||
</label>
|
||||
<select id="persCat" @change="update_setting('personality_category', $event.target.value, refresh)"
|
||||
<select id="persCat" @change="update_personality_category($event.target.value, refresh)"
|
||||
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">
|
||||
|
||||
<option v-for="(item, index) in persCatgArr" :key="index"
|
||||
@ -1321,6 +1321,10 @@ export default {
|
||||
data() {
|
||||
|
||||
return {
|
||||
// Current personality language
|
||||
personality_language:null,
|
||||
// Current personality category
|
||||
personality_category:null,
|
||||
// install custom model
|
||||
addModelDialogVisibility: false,
|
||||
modelPath: '',
|
||||
@ -1400,6 +1404,8 @@ export default {
|
||||
|
||||
|
||||
//await this.getPersonalitiesArr()
|
||||
this.personality_language = this.configFile.personality_language
|
||||
this.personality_category = this.configFile.personality_category
|
||||
this.personalitiesFiltered = this.personalities.filter((item) => item.category === this.configFile.personality_category && item.language === this.configFile.personality_language)
|
||||
this.personalitiesFiltered.sort()
|
||||
//mountedPersArr
|
||||
@ -2032,9 +2038,25 @@ export default {
|
||||
onMessageBoxOk() {
|
||||
console.log("OK button clicked");
|
||||
},
|
||||
update_personality_language(lang, next){
|
||||
this.personality_language = lang
|
||||
next()
|
||||
},
|
||||
|
||||
update_personality_category(cat, next){
|
||||
this.personality_category = cat
|
||||
next()
|
||||
},
|
||||
// Refresh stuff
|
||||
refresh() {
|
||||
console.log("Refreshing")
|
||||
this.$store.dispatch('refreshConfig').then(() => {
|
||||
console.log(this.personality_language)
|
||||
console.log(this.personality_category)
|
||||
this.personalitiesFiltered = this.personalities.filter((item) => item.category === this.personality_category && item.language === this.personality_language)
|
||||
this.personalitiesFiltered.sort()
|
||||
});
|
||||
|
||||
//this.fetchMainConfig();
|
||||
//this.fetchBindings();
|
||||
//this.fetchModels();
|
||||
|
Loading…
x
Reference in New Issue
Block a user