This commit is contained in:
Saifeddine ALOUI 2023-12-12 00:24:47 +01:00
parent 21985dc2bb
commit 4b6aaca672
12 changed files with 105 additions and 39 deletions

View File

@ -1013,7 +1013,7 @@ class LoLLMsAPI(LollmsApplication):
ASCIIColors.blue(f"Your personal data is stored here :",end="")
ASCIIColors.green(f"{self.lollms_paths.personal_path}")
def audio_callback(self, text):
def audio_callback(self, output):
if self.summoned:
client_id = 0
self.cancel_gen = False
@ -1057,7 +1057,7 @@ class LoLLMsAPI(LollmsApplication):
else:
self.error("I am busy. Come back later.", client_id=client_id)
else:
if text.lower()=="lollms":
if output["text"].lower()=="lollms":
self.summoned = True
def rebuild_personalities(self, reload_all=False):
if reload_all:

@ -1 +1 @@
Subproject commit 2e77d696ded386d7ead9393425a024565a7a97d7
Subproject commit 113e5531e53f562c9c22de64236222b9ed9d9a00

File diff suppressed because one or more lines are too long

8
web/dist/assets/index-6e0a42ab.css vendored Normal file

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-b9dab24e.js"></script>
<link rel="stylesheet" href="/assets/index-3789d6b8.css">
<script type="module" crossorigin src="/assets/index-da6af66f.js"></script>
<link rel="stylesheet" href="/assets/index-6e0a42ab.css">
</head>
<body>
<div id="app"></div>

View File

@ -0,0 +1,63 @@
<template>
<div class="floating-frame">
<img v-if="isAudioActive" :src="imageDataUrl" alt="Spectrogram" width="300" height="300" />
<div class="controls">
<button v-if="!isAudioActive" class="w-full bg-green-500 hover:bg-green-700 text-white font-bold py-2 px-4 rounded" @click="startAudioStream">Activate Audio</button>
<button v-if="isAudioActive" class="w-full bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded" @click="stopAudioStream">Deactivate Audio</button>
</div>
</div>
</template>
<script>
import socket from '@/services/websocket.js';
export default {
data() {
return {
isAudioActive: false,
imageDataUrl: null
};
},
methods: {
startAudioStream() {
this.isAudioActive = true;
socket.emit('start_audio_stream');
},
stopAudioStream() {
this.isAudioActive = false;
this.imageData = null;
socket.emit('stop_audio_stream');
}
},
mounted() {
socket.on('update_spectrogram', (imageBase64) => {
if (this.isAudioActive) {
this.imageDataUrl = 'data:image/jpeg;base64,' + imageBase64;
}
});
}
};
</script>
<style>
.floating-frame {
margin: 15px;
float: left;
width: 800px;
height: auto;
border: 1px solid #000;
border-radius: 4px;
overflow: hidden;
z-index: 5000;
}
.floating-frame img {
width: 100%;
height: auto;
}
.controls {
margin-top: 10px;
}
</style>

View File

@ -324,7 +324,7 @@ console.log("modelImgPlaceholder:",modelImgPlaceholder)
const bUrl = import.meta.env.VITE_LOLLMS_API_BASEURL
export default {
name: 'ChatBox',
emits: ["messageSentEvent", "sendCMDEvent", "stopGenerating", "loaded", "createEmptyUserMessage", "createEmptyAIMessage"],
emits: ["messageSentEvent", "sendCMDEvent", "stopGenerating", "loaded", "createEmptyUserMessage", "createEmptyAIMessage", "personalitySelected"],
props: {
onTalk: Function,
discussionList: Array,
@ -541,6 +541,8 @@ export default {
}
this.$emit('personalitySelected')
nextTick(() => {
feather.replace()

View File

@ -7,7 +7,7 @@
<div class="flex items-center gap-3 flex-1">
<img class="w-12 hover:scale-95 duration-150 " title="LoLLMS WebUI" src="@/assets/logo.png" alt="Logo">
<div class="flex flex-col">
<p class="text-2xl ">Lord of Large Language Models</p>
<p class="text-2xl ">Lord of Large Language and Multimodal Systems</p>
<p class="text-gray-400 ">One tool to rule them all</p>
</div>
@ -18,10 +18,10 @@
<div class="flex gap-3 flex-1 items-center justify-end">
<div v-if="isModelOK" title="Model is ok" class="text-green-500 cursor-pointer">
<b>M</b>
<b class="text-2xl">M</b>
</div>
<div v-if="!isModelOK" title="Model is not ok" class="text-red-500 cursor-pointer">
<b>M</b>
<b class="text-2xl">M</b>
</div>
<div v-if="!isGenerating" title="Text is not being generated. Ready to generate" class="text-green-500 cursor-pointer">
<i data-feather="flag"></i>

View File

@ -7,7 +7,7 @@
<img class="w-24 animate-bounce" title="LoLLMS WebUI" src="@/assets/logo.png" alt="Logo">
<div class="flex flex-col items-start">
<p class="text-2xl ">Lord of Large Language Models</p>
<p class="text-2xl ">Lord of Large Language and Multimodal Systems</p>
<p class="text-gray-400 text-base">One tool to rule them all</p>
</div>

View File

@ -10,7 +10,7 @@
<img class="w-24 animate-bounce" title="LoLLMS WebUI" src="@/assets/logo.png" alt="Logo">
<div class="flex flex-col items-start">
<p class="text-2xl ">Lord of Large Language Models {{ version_info }} </p>
<p class="text-2xl ">Lord of Large Language and Multimodal Systems {{ version_info }} </p>
<p class="text-gray-400 text-base">One tool to rule them all</p>
<p class="text-gray-400 text-base">by ParisNeo</p>
@ -261,6 +261,7 @@
:discussionList="discussionArr"
:on-show-toast-message="showToastMessage"
:on-talk="talk"
@personalitySelected="recoverFiles"
@messageSentEvent="sendMsg"
@sendCMDEvent="sendCmd"
@createEmptyUserMessage="createEmptyUserMessage"

View File

@ -1,17 +1,17 @@
<template>
<div class="flex-col">
<div v-if="!activePersonality || !activePersonality.scene_path" class="text-center">
<!-- Display text when there's no scene_path or empty avatar -->
Personality does not have a 3d avatar.
</div>
<div v-if="!activePersonality || (!activePersonality.avatar || activePersonality.avatar === '')" class="text-center">
Personality does not have an avatar.
</div>
<FloatingFrame />
<AudioFrame />
<div class="floating-frame2">
<div v-html="htmlContent"></div>
</div>
<div class="flex-col w-[800]px y-overflow scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary">
<div v-if="!activePersonality || !activePersonality.scene_path" class="text-center">
<!-- Display text when there's no scene_path or empty avatar -->
Personality does not have a 3d avatar.
</div>
<div v-if="!activePersonality || (!activePersonality.avatar || activePersonality.avatar === '')" class="text-center">
Personality does not have an avatar.
</div>
<FloatingFrame />
<AudioFrame />
<div class="floating-frame2">
<div v-html="htmlContent"></div>
</div>
</div>
<div ref="webglContainer">
</div>
@ -164,7 +164,7 @@
.floating-frame2 {
margin: 15px;
float: left;
width: 200px;
width: 800px;
height: auto;
border: 1px solid #000;
border-radius: 4px;