mirror of
https://github.com/ParisNeo/lollms-webui.git
synced 2025-01-18 02:39:47 +00:00
sync
This commit is contained in:
parent
fca7c54748
commit
3c33cb55a0
@ -1 +1 @@
|
||||
Subproject commit 0337e8a38bbbfe12d34a7eea304710b355826f3c
|
||||
Subproject commit 62677f4ee5e6c01ab83a25abf9e90182acd48487
|
@ -759,7 +759,7 @@ class LOLLMSWebUI(LOLLMSElfServer):
|
||||
self.personality.step_start("Crafting internet search query")
|
||||
query = self.personality.fast_gen(f"!@>discussion:\n{discussion[-2048:]}\n!@>instruction: Read the discussion and craft a web search query suited to recover needed information to reply to last {self.config.user_name} message.\nDo not answer the prompt. Do not add explanations.\n!@>websearch query: ", max_generation_size=256, show_progress=True, callback=self.personality.sink)
|
||||
self.personality.step_end("Crafting internet search query")
|
||||
self.personality.step(f"query:{query}")
|
||||
self.personality.step(f"web search query: {query}")
|
||||
|
||||
self.personality.step_start("Performing Internet search")
|
||||
|
||||
@ -874,7 +874,7 @@ class LOLLMSWebUI(LOLLMSElfServer):
|
||||
|
||||
# Raise an error if the available space is 0 or less
|
||||
if available_space<1:
|
||||
self.error("Not enough space in context!!")
|
||||
self.error(f"Not enough space in context!!\nVerify that your vectorization settings for documents or internet search are realistic compared to your context size.\nYou are {available_space} short of context!")
|
||||
raise Exception("Not enough space in context!!")
|
||||
|
||||
# Accumulate messages until the cumulative number of tokens exceeds available_space
|
||||
@ -1381,6 +1381,7 @@ class LOLLMSWebUI(LOLLMSElfServer):
|
||||
# send the message to the bot
|
||||
print(f"Received message : {message.content}")
|
||||
if self.connections[client_id]["current_discussion"]:
|
||||
try:
|
||||
if not self.model:
|
||||
self.error("No model selected. Please make sure you select a model before starting generation", client_id=client_id)
|
||||
return
|
||||
@ -1418,12 +1419,12 @@ class LOLLMSWebUI(LOLLMSElfServer):
|
||||
fn = f"{fn}_{message_id}.wav"
|
||||
url = f"audio/{fn}"
|
||||
self.tts.tts_to_file(self.connections[client_id]["generated_text"], Path(self.personality.audio_samples[0]).name, f"{fn}", language=language)
|
||||
fl = f"""
|
||||
<audio controls>
|
||||
<source src="{url}" type="audio/wav">
|
||||
Your browser does not support the audio element.
|
||||
</audio>
|
||||
"""
|
||||
fl = f"\n".join([
|
||||
f"<audio controls>",
|
||||
f' <source src="{url}" type="audio/wav">',
|
||||
f' Your browser does not support the audio element.',
|
||||
f'</audio>'
|
||||
])
|
||||
self.process_chunk("Generating voice output", MSG_TYPE.MSG_TYPE_STEP_END, {'status':True},client_id=client_id)
|
||||
self.process_chunk(fl,MSG_TYPE.MSG_TYPE_UI, client_id=client_id)
|
||||
|
||||
@ -1476,12 +1477,14 @@ class LOLLMSWebUI(LOLLMSElfServer):
|
||||
sources_text += '<div class="text-gray-400 mr-10px">Sources:</div>'
|
||||
for source in internet_search_infos:
|
||||
url = source["url"]
|
||||
title = source["title"]
|
||||
brief = source["brief"]
|
||||
favicon_url = get_favicon_url(url)
|
||||
if favicon_url is None:
|
||||
favicon_url ="/personalities/internet/loi/assets/logo.png"
|
||||
root_url = get_root_url(url)
|
||||
sources_text += "\n".join([
|
||||
f'<a class="flex items-center gap-2 whitespace-nowrap rounded-lg border bg-white px-2 py-1.5 leading-none hover:border-gray-300 dark:border-gray-800 dark:bg-gray-900 dark:hover:border-gray-700" target="_blank" href="{url}">',
|
||||
f'<a class="relative flex items-center gap-2 whitespace-nowrap rounded-lg border bg-white px-2 py-1.5 leading-none hover:border-gray-300 dark:border-gray-800 dark:bg-gray-900 dark:hover:border-gray-700" target="_blank" href="{url}" title="{brief}">',
|
||||
f' <img class="h-3.5 w-3.5 rounded" src="{favicon_url}">',
|
||||
f' <div>{root_url}</div>',
|
||||
f'</a>',
|
||||
@ -1489,6 +1492,8 @@ class LOLLMSWebUI(LOLLMSElfServer):
|
||||
sources_text += '</div>'
|
||||
self.connections[client_id]["generated_text"]=self.connections[client_id]["generated_text"].split("!@>")[0] + "\n" + sources_text
|
||||
self.personality.full(self.connections[client_id]["generated_text"])
|
||||
except:
|
||||
pass
|
||||
self.close_message(client_id)
|
||||
self.update_message(client_id, "Generating ...", msg_type=MSG_TYPE.MSG_TYPE_STEP_END)
|
||||
|
||||
|
@ -29,3 +29,6 @@ python-multipart
|
||||
python-socketio
|
||||
python-socketio[client]
|
||||
python-socketio[asyncio_client]
|
||||
|
||||
|
||||
selenium
|
@ -1,14 +1,34 @@
|
||||
colorama
|
||||
datasets
|
||||
einops
|
||||
jinja2==3.1.3
|
||||
numpy==1.24.*
|
||||
pandas
|
||||
Pillow>=9.5.0
|
||||
pyyaml
|
||||
requests
|
||||
rich
|
||||
safetensors==0.4.1
|
||||
scipy
|
||||
sentencepiece
|
||||
tensorboard
|
||||
transformers==4.37.*
|
||||
tqdm
|
||||
setuptools
|
||||
tqdm
|
||||
psutil
|
||||
pytest
|
||||
pyyaml
|
||||
markdown
|
||||
gevent
|
||||
gevent-websocket
|
||||
requests
|
||||
eventlet
|
||||
websocket-client
|
||||
GitPython
|
||||
setuptools
|
||||
numpy
|
||||
ascii_colors>=0.1.4
|
||||
beautifulsoup4
|
||||
packaging
|
||||
|
||||
fastapi
|
||||
uvicorn
|
||||
python-multipart
|
||||
python-socketio
|
||||
python-socketio[client]
|
||||
python-socketio[asyncio_client]
|
||||
|
||||
|
||||
selenium
|
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-e3a9f414.js"></script>
|
||||
<link rel="stylesheet" href="/assets/index-b55bf791.css">
|
||||
<script type="module" crossorigin src="/assets/index-3b9f838e.js"></script>
|
||||
<link rel="stylesheet" href="/assets/index-5f320cbc.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
@ -2,16 +2,21 @@
|
||||
|
||||
<form>
|
||||
<div class="absolute bottom-0 left-0 w-fit min-w-96 w-full justify-center text-center p-4">
|
||||
<div class="items-center gap-2 rounded-lg border bg-white p-1.5 shadow-sm hover:shadow-none dark:border-gray-800 dark:bg-gray-900 w-fit">
|
||||
<div v-if="filesList.length > 0 || showPersonalities" class="items-center gap-2 rounded-lg border bg-white p-1.5 shadow-sm hover:shadow-none dark:border-gray-800 dark:bg-gray-900 w-fit">
|
||||
<!-- EXPAND / COLLAPSE BUTTON -->
|
||||
<div class="flex">
|
||||
<button v-if="filesList.length > 0"
|
||||
<button
|
||||
class="mx-1 w-full text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg "
|
||||
:title="showfilesList ? 'Hide file list' : 'Show file list'" type="button"
|
||||
@click.stop=" showfilesList = !showfilesList">
|
||||
<i data-feather="list"></i>
|
||||
</button>
|
||||
</div>
|
||||
<button v-if="loading" type="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"
|
||||
@click.stop="stopGenerating">
|
||||
Stop generating
|
||||
</button>
|
||||
<!-- FILES -->
|
||||
<div v-if="filesList.length > 0 && showfilesList ==true">
|
||||
<div class="flex flex-col max-h-64 ">
|
||||
@ -94,7 +99,7 @@
|
||||
@click="clear_files">
|
||||
<i data-feather="trash" class="w-5 h-5 "></i>
|
||||
</button>
|
||||
<button type="button" title="Clear all"
|
||||
<button type="button" title="Download database"
|
||||
class="flex items-center p-0.5 text-sm rounded-sm hover:text-red-600 active:scale-75"
|
||||
@click="download_database">
|
||||
<i data-feather="download-cloud" class="w-5 h-5 "></i>
|
||||
@ -119,15 +124,6 @@
|
||||
<span class="sr-only">Selecting model...</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button v-if="loading" type="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"
|
||||
@click.stop="stopGenerating">
|
||||
Stop generating
|
||||
</button>
|
||||
|
||||
|
||||
|
||||
<div class="flex w-fit pb-3 relative grow w-full">
|
||||
<div class="relative grow flex h-15 cursor-pointer select-none items-center gap-2 rounded-lg border bg-white p-1.5 shadow-sm hover:shadow-none dark:border-gray-800 dark:bg-gray-900" tabindex="0">
|
||||
<div v-if="loading" title="Waiting for reply">
|
||||
@ -805,8 +801,12 @@ export default {
|
||||
},
|
||||
|
||||
removeItem(file) {
|
||||
console.log(file)
|
||||
axios.post('/remove_file',{file}).then(()=>{
|
||||
this.filesList = this.filesList.filter((item) => item != file)
|
||||
// console.log(this.filesList)
|
||||
})
|
||||
|
||||
console.log(this.filesList)
|
||||
},
|
||||
sendMessageEvent(msg) {
|
||||
this.$emit('messageSentEvent', msg)
|
||||
|
@ -174,15 +174,7 @@
|
||||
>
|
||||
<i data-feather="voicemail"></i>
|
||||
</div>
|
||||
<svg v-else aria-hidden="true" class="w-6 h-6 animate-spin fill-secondary" viewBox="0 0 100 101 cursor-pointer" title="Generating voice, please stand by ..."
|
||||
fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z"
|
||||
fill="currentColor" />
|
||||
<path
|
||||
d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z"
|
||||
fill="currentFill" />
|
||||
</svg>
|
||||
<img v-else :src="loading_svg">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@ -206,7 +198,7 @@
|
||||
<div class="content px-5 pb-5 pt-4">
|
||||
<ol class="list-none">
|
||||
<div v-for="(step, index) in message.steps" :key="'step-' + message.id + '-' + index" class="group border-l pb-6 last:!border-transparent last:pb-0 dark:border-gray-800" :style="{ backgroundColor: step.done ? 'transparent' : 'inherit' }">
|
||||
<Step :done="step.done" :message="step.message" :status="step.status" />
|
||||
<Step :done="step.done" :message="step.message" :status="step.status" :step_type = "step.type"/>
|
||||
</div>
|
||||
</ol>
|
||||
</div>
|
||||
@ -472,6 +464,7 @@ export default {
|
||||
else{
|
||||
this.isSynthesizingVoice=true
|
||||
axios.post("./text2Audio",{text:this.message.content}).then(response => {
|
||||
this.isSynthesizingVoice=false
|
||||
let url = response.data.url
|
||||
console.log(url)
|
||||
this.audio_url = url
|
||||
|
@ -1,20 +1,20 @@
|
||||
<template>
|
||||
<div class="flex items-start">
|
||||
<div class="step flex items-center mb-4">
|
||||
<div class="flex items-center justify-center w-6 h-6 mr-2">
|
||||
<div v-if="!done && type=='start_end'">
|
||||
<div v-if="step_type=='start_end'" class="flex items-center justify-center w-6 h-6 mr-2">
|
||||
<div v-if="!done">
|
||||
<i
|
||||
data-feather="square"
|
||||
class="text-gray-400 w-4 h-4"
|
||||
></i>
|
||||
</div>
|
||||
<div v-if="done && status && type=='start_end'">
|
||||
<div v-if="done && status">
|
||||
<i
|
||||
data-feather="check-square"
|
||||
class="text-green-500 w-4 h-4"
|
||||
></i>
|
||||
</div>
|
||||
<div v-if="done && !status && type=='start_end'">
|
||||
<div v-if="done && !status">
|
||||
<i
|
||||
data-feather="x-square"
|
||||
class="text-red-500 w-4 h-4"
|
||||
@ -56,7 +56,7 @@
|
||||
type: Boolean,
|
||||
required: true
|
||||
},
|
||||
type: {
|
||||
step_type: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: 'start_end'
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit cd9661448f09f70f59c73bf513dd7052f1e147fc
|
||||
Subproject commit 2904be08e6326c25e7a1901f8bf7470ae2faf76b
|
Loading…
Reference in New Issue
Block a user