enhanced game

This commit is contained in:
Saifeddine ALOUI 2024-08-14 23:34:34 +02:00
parent c90496a0dc
commit ad03cafc1d
9 changed files with 242 additions and 223 deletions

@ -1 +1 @@
Subproject commit 7ebeeb347a2abd76d70c1ff1368d83981e3b6f0e Subproject commit 4b59ab3f501428138ac6e28a245bcddd0ab85fa9

View File

@ -873,7 +873,7 @@ class LOLLMSWebUI(LOLLMSElfServer):
if self.nb_received_tokens==1: if self.nb_received_tokens==1:
client.discussion.current_message.started_generating_at=datetime.now().strftime('%Y-%m-%d %H:%M:%S') client.discussion.current_message.started_generating_at=datetime.now().strftime('%Y-%m-%d %H:%M:%S')
self.update_message_step(client_id, " warming up ...",MSG_OPERATION_TYPE.MSG_OPERATION_TYPE_STEP_END_SUCCESS) self.update_message_step(client_id, "🔥 warming up ...",MSG_OPERATION_TYPE.MSG_OPERATION_TYPE_STEP_END_SUCCESS)
self.update_message_step(client_id, "✍ generating ...",MSG_OPERATION_TYPE.MSG_OPERATION_TYPE_STEP_END_SUCCESS) self.update_message_step(client_id, "✍ generating ...",MSG_OPERATION_TYPE.MSG_OPERATION_TYPE_STEP_END_SUCCESS)
run_async( run_async(
@ -957,11 +957,7 @@ class LOLLMSWebUI(LOLLMSElfServer):
'id':client.discussion.current_message.id, 'id':client.discussion.current_message.id,
'metadata': metadata if type(metadata) in [str, None] else json.dumps(metadata) if type(metadata)==dict else None, 'metadata': metadata if type(metadata) in [str, None] else json.dumps(metadata) if type(metadata)==dict else None,
'discussion_id':client.discussion.discussion_id, 'discussion_id':client.discussion.discussion_id,
'message_type': MSG_OPERATION_TYPE.MSG_TYPE_JSON_INFOS, 'operation_type': MSG_OPERATION_TYPE.MSG_OPERATION_TYPE_JSON_INFOS,
'created_at':client.discussion.current_message.created_at,
'started_generating_at': client.discussion.current_message.started_generating_at,
'finished_generating_at': client.discussion.current_message.finished_generating_at,
'nb_tokens': client.discussion.current_message.nb_tokens,
}, to=client_id }, to=client_id
) )
) )
@ -976,11 +972,7 @@ class LOLLMSWebUI(LOLLMSElfServer):
'id':client.discussion.current_message.id, 'id':client.discussion.current_message.id,
'ui': ui if type(ui) in [str, None] else None, 'ui': ui if type(ui) in [str, None] else None,
'discussion_id':client.discussion.discussion_id, 'discussion_id':client.discussion.discussion_id,
'message_type': MSG_OPERATION_TYPE.MSG_OPERATION_TYPE_UI, 'operation_type': MSG_OPERATION_TYPE.MSG_OPERATION_TYPE_UI,
'created_at':client.discussion.current_message.created_at,
'started_generating_at': client.discussion.current_message.started_generating_at,
'finished_generating_at': client.discussion.current_message.finished_generating_at,
'nb_tokens': client.discussion.current_message.nb_tokens,
}, to=client_id }, to=client_id
) )
) )
@ -1072,13 +1064,13 @@ class LOLLMSWebUI(LOLLMSElfServer):
if operation_type == MSG_OPERATION_TYPE.MSG_OPERATION_TYPE_NEW_MESSAGE: if operation_type == MSG_OPERATION_TYPE.MSG_OPERATION_TYPE_NEW_MESSAGE:
self.nb_received_tokens = 0 self.nb_received_tokens = 0
self.start_time = datetime.now() self.start_time = datetime.now()
self.update_message_step(client_id, " warming up ...", MSG_OPERATION_TYPE.MSG_OPERATION_TYPE_STEP_END_SUCCESS) self.update_message_step(client_id, "🔥 warming up ...", MSG_OPERATION_TYPE.MSG_OPERATION_TYPE_STEP_END_SUCCESS)
self.update_message_step(client_id, "✍ generating ...",MSG_OPERATION_TYPE.MSG_OPERATION_TYPE_STEP_END_SUCCESS) self.update_message_step(client_id, "✍ generating ...",MSG_OPERATION_TYPE.MSG_OPERATION_TYPE_STEP_END_SUCCESS)
self.new_message( self.new_message(
client_id, client_id,
self.personality.name if personality is None else personality.name, self.personality.name if personality is None else personality.name,
chunk, chunk,
operation_type= MSG_TYPE.MSG_TYPE_CONTENT message_type = MSG_TYPE.MSG_TYPE_CONTENT
) )
elif operation_type == MSG_OPERATION_TYPE.MSG_OPERATION_TYPE_FINISHED_MESSAGE: elif operation_type == MSG_OPERATION_TYPE.MSG_OPERATION_TYPE_FINISHED_MESSAGE:
@ -1088,7 +1080,7 @@ class LOLLMSWebUI(LOLLMSElfServer):
if self.nb_received_tokens==0: if self.nb_received_tokens==0:
self.start_time = datetime.now() self.start_time = datetime.now()
try: try:
self.update_message_step(client_id, " warming up ...",MSG_OPERATION_TYPE.MSG_OPERATION_TYPE_STEP_END_SUCCESS) self.update_message_step(client_id, "🔥 warming up ...",MSG_OPERATION_TYPE.MSG_OPERATION_TYPE_STEP_END_SUCCESS)
self.update_message_step(client_id, "✍ generating ...",MSG_OPERATION_TYPE.MSG_OPERATION_TYPE_STEP_END_SUCCESS) self.update_message_step(client_id, "✍ generating ...",MSG_OPERATION_TYPE.MSG_OPERATION_TYPE_STEP_END_SUCCESS)
except Exception as ex: except Exception as ex:
trace_exception(ex) trace_exception(ex)
@ -1131,7 +1123,7 @@ class LOLLMSWebUI(LOLLMSElfServer):
if self.nb_received_tokens==0: if self.nb_received_tokens==0:
self.start_time = datetime.now() self.start_time = datetime.now()
try: try:
self.update_message_step(client_id, " warming up ...", MSG_OPERATION_TYPE.MSG_OPERATION_TYPE_STEP_END_SUCCESS) self.update_message_step(client_id, "🔥 warming up ...", MSG_OPERATION_TYPE.MSG_OPERATION_TYPE_STEP_END_SUCCESS)
self.update_message_step(client_id, "✍ generating ...",MSG_OPERATION_TYPE.MSG_OPERATION_TYPE_STEP_END_SUCCESS) self.update_message_step(client_id, "✍ generating ...",MSG_OPERATION_TYPE.MSG_OPERATION_TYPE_STEP_END_SUCCESS)
except Exception as ex: except Exception as ex:
@ -1334,7 +1326,7 @@ class LOLLMSWebUI(LOLLMSElfServer):
else: else:
self.send_refresh(client_id) self.send_refresh(client_id)
self.new_message(client_id, self.personality.name, "") self.new_message(client_id, self.personality.name, "")
self.update_message_step(client_id, " warming up ...", MSG_OPERATION_TYPE.MSG_OPERATION_TYPE_STEP_START) self.update_message_step(client_id, "🔥 warming up ...", MSG_OPERATION_TYPE.MSG_OPERATION_TYPE_STEP_START)
# prepare query and reception # prepare query and reception
self.discussion_messages, self.current_message, tokens, context_details, internet_search_infos = self.prepare_query(client_id, message_id, is_continue, n_tokens=self.config.min_n_predict, generation_type=generation_type, force_using_internet=force_using_internet, previous_chunk = client.generated_text if is_continue else "") self.discussion_messages, self.current_message, tokens, context_details, internet_search_infos = self.prepare_query(client_id, message_id, is_continue, n_tokens=self.config.min_n_predict, generation_type=generation_type, force_using_internet=force_using_internet, previous_chunk = client.generated_text if is_continue else "")
@ -1497,7 +1489,7 @@ class LOLLMSWebUI(LOLLMSElfServer):
except Exception as ex: except Exception as ex:
trace_exception(ex) trace_exception(ex)
try: try:
self.update_message_step(client_id, " warming up ...", MSG_OPERATION_TYPE.MSG_OPERATION_TYPE_STEP_END_SUCCESS) self.update_message_step(client_id, "🔥 warming up ...", MSG_OPERATION_TYPE.MSG_OPERATION_TYPE_STEP_END_SUCCESS)
self.update_message_step(client_id, "✍ generating ...",MSG_OPERATION_TYPE.MSG_OPERATION_TYPE_STEP_END_SUCCESS) self.update_message_step(client_id, "✍ generating ...",MSG_OPERATION_TYPE.MSG_OPERATION_TYPE_STEP_END_SUCCESS)
except Exception as ex: except Exception as ex:
ASCIIColors.warning("Couldn't send status update to client") ASCIIColors.warning("Couldn't send status update to client")

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

8
web/dist/assets/index-863505e1.css vendored Normal file

File diff suppressed because one or more lines are too long

4
web/dist/index.html vendored
View File

@ -6,8 +6,8 @@
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js"></script> <script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>LoLLMS WebUI</title> <title>LoLLMS WebUI</title>
<script type="module" crossorigin src="/assets/index-ae808653.js"></script> <script type="module" crossorigin src="/assets/index-46ea45b9.js"></script>
<link rel="stylesheet" href="/assets/index-7271416c.css"> <link rel="stylesheet" href="/assets/index-863505e1.css">
</head> </head>
<body> <body>
<div id="app"></div> <div id="app"></div>

View File

@ -288,12 +288,39 @@
placeholder="Send message..." @keydown.enter.exact="submitOnEnter($event)"> placeholder="Send message..." @keydown.enter.exact="submitOnEnter($event)">
</textarea> </textarea>
</div> </div>
<button v-if="loading" type="button" <button
class="bg-red-500 dark:bg-red-800 hover:bg-red-600 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 mr-2 mb-2 dark:hover:bg-bg-dark-tone focus:outline-none dark:focus:ring-blue-800" v-if="loading"
@click.stop="stopGenerating"> type="button"
Stop generating class="relative bg-red-500 dark:bg-red-800 hover:bg-red-600 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-10 py-2.5 mr-2 mb-2 dark:hover:bg-red-700 focus:outline-none dark:focus:ring-blue-800 transition-all duration-300 ease-in-out overflow-hidden"
@click.stop="stopGenerating"
>
<span class="flex items-center justify-center">
<svg
class="animate-spin -ml-1 mr-3 h-5 w-5 text-white"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
>
<circle
class="opacity-25"
cx="12"
cy="12"
r="10"
stroke="currentColor"
stroke-width="4"
></circle>
<path
class="opacity-75"
fill="currentColor"
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
></path>
</svg>
Stop generating
</span>
<span
class="absolute top-0 left-0 w-full h-full bg-white opacity-25 transform scale-x-0 origin-left transition-transform duration-300 ease-out group-hover:scale-x-100"
></span>
</button> </button>
<div class="group relative w-max"> <div class="group relative w-max">
<button v-if="!loading" type="button" @click="submit" title="Send" <button v-if="!loading" type="button" @click="submit" title="Send"
class="w-6 text-panel hover:text-secondary duration-75 active:scale-90 cursor-pointer transform transition-transform hover:translate-y-[-5px] active:scale-90"> class="w-6 text-panel hover:text-secondary duration-75 active:scale-90 cursor-pointer transform transition-transform hover:translate-y-[-5px] active:scale-90">

View File

@ -21,19 +21,19 @@
<h1 class="text-5xl md:text-6xl font-bold text-transparent bg-clip-text bg-gradient-to-r from-blue-600 to-purple-600 dark:from-blue-400 dark:to-purple-400 mb-2 animate-glow"> <h1 class="text-5xl md:text-6xl font-bold text-transparent bg-clip-text bg-gradient-to-r from-blue-600 to-purple-600 dark:from-blue-400 dark:to-purple-400 mb-2 animate-glow">
Lord Of Large Language & Multimodal Systems Lord Of Large Language & Multimodal Systems
</h1> </h1>
<p class="text-2xl text-gray-600 dark:text-gray-300 italic">
{{ version_info }}
</p>
<p class="text-2xl text-gray-600 dark:text-gray-300 italic"> <p class="text-2xl text-gray-600 dark:text-gray-300 italic">
One tool to rule them all One tool to rule them all
</p> </p>
<p class="text-xl text-gray-500 dark:text-gray-400 mb-6"> <p class="text-xl text-gray-500 dark:text-gray-400 mb-6">
by ParisNeo by ParisNeo
</p> </p>
<p class="bottom-0 text-2xl text-gray-600 dark:text-gray-300 italic">
{{ version_info }}
</p>
<div class="w-full h-24 relative overflow-hidden bg-gradient-to-r from-blue-200 to-purple-200 dark:from-blue-800 dark:to-purple-800 rounded-full shadow-lg"> <div class="w-full h-24 relative overflow-hidden bg-gradient-to-r from-blue-200 to-purple-200 dark:from-blue-800 dark:to-purple-800 rounded-full shadow-lg">
<img <img
class="w-24 h-24 rounded-full absolute top-0 transition-all duration-300 ease-linear" class="w-24 h-24 animate-glow rounded-full absolute top-0 transition-all duration-300 ease-linear"
:style="{ left: `calc(${loading_progress}% - 3rem)` }" :style="{ left: `calc(${loading_progress}% - 3rem)` }"
title="LoLLMS WebUI" title="LoLLMS WebUI"
src="@/assets/logo.png" src="@/assets/logo.png"
@ -53,7 +53,7 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</transition> </transition>
<button v-if="isReady" @click="togglePanel" class="absolute top-2 left-2 p-3 bg-white bg-opacity-0 cursor-pointer transition-all duration-300 hover:scale-110 hover:bg-opacity-20 hover:shadow-xl group"> <button v-if="isReady" @click="togglePanel" class="absolute top-2 left-2 p-3 bg-white bg-opacity-0 cursor-pointer transition-all duration-300 hover:scale-110 hover:bg-opacity-20 hover:shadow-xl group">

@ -1 +1 @@
Subproject commit 27613f177a0a1737a2e8d6354b0fa656a376baff Subproject commit a80d7d87da902c6bd9d09ec5f86e1516b1815b4c