mirror of
https://github.com/ParisNeo/lollms-webui.git
synced 2025-01-31 00:23:52 +00:00
Enhanced ui
This commit is contained in:
parent
cfcb925f58
commit
24e56537ff
@ -1203,7 +1203,7 @@ class LoLLMsAPI(LollmsApplication):
|
|||||||
selected_language=personality.split(":")[1] if ":" in personality else None,
|
selected_language=personality.split(":")[1] if ":" in personality else None,
|
||||||
run_scripts=True)
|
run_scripts=True)
|
||||||
mounted_personalities.append(personality)
|
mounted_personalities.append(personality)
|
||||||
if self.config.auto_read and len(personality.audio_samples)>0:
|
if self.config.enable_voice_service and self.config.auto_read and len(personality.audio_samples)>0:
|
||||||
try:
|
try:
|
||||||
from lollms.audio_gen_modules.lollms_xtts import LollmsXTTS
|
from lollms.audio_gen_modules.lollms_xtts import LollmsXTTS
|
||||||
if self.tts is None:
|
if self.tts is None:
|
||||||
@ -2073,7 +2073,7 @@ class LoLLMsAPI(LollmsApplication):
|
|||||||
client_id=client_id,
|
client_id=client_id,
|
||||||
callback=partial(self.process_chunk,client_id = client_id)
|
callback=partial(self.process_chunk,client_id = client_id)
|
||||||
)
|
)
|
||||||
if self.config.auto_read and len(self.personality.audio_samples)>0:
|
if self.config.enable_voice_service and self.config.auto_read and len(self.personality.audio_samples)>0:
|
||||||
try:
|
try:
|
||||||
self.process_chunk("Generating voice output",MSG_TYPE.MSG_TYPE_STEP_START,client_id=client_id)
|
self.process_chunk("Generating voice output",MSG_TYPE.MSG_TYPE_STEP_START,client_id=client_id)
|
||||||
from lollms.audio_gen_modules.lollms_xtts import LollmsXTTS
|
from lollms.audio_gen_modules.lollms_xtts import LollmsXTTS
|
||||||
|
9
app.py
9
app.py
@ -257,11 +257,9 @@ try:
|
|||||||
)
|
)
|
||||||
|
|
||||||
self.add_endpoint("/start_training", "start_training", self.start_training, methods=["POST"])
|
self.add_endpoint("/start_training", "start_training", self.start_training, methods=["POST"])
|
||||||
|
|
||||||
self.add_endpoint("/get_lollms_version", "get_lollms_version", self.get_lollms_version, methods=["GET"])
|
self.add_endpoint("/get_lollms_version", "get_lollms_version", self.get_lollms_version, methods=["GET"])
|
||||||
self.add_endpoint("/get_lollms_webui_version", "get_lollms_webui_version", self.get_lollms_webui_version, methods=["GET"])
|
self.add_endpoint("/get_lollms_webui_version", "get_lollms_webui_version", self.get_lollms_webui_version, methods=["GET"])
|
||||||
|
|
||||||
|
|
||||||
self.add_endpoint("/reload_binding", "reload_binding", self.reload_binding, methods=["POST"])
|
self.add_endpoint("/reload_binding", "reload_binding", self.reload_binding, methods=["POST"])
|
||||||
self.add_endpoint("/restart_program", "restart_program", self.restart_program, methods=["GET"])
|
self.add_endpoint("/restart_program", "restart_program", self.restart_program, methods=["GET"])
|
||||||
self.add_endpoint("/update_software", "update_software", self.update_software, methods=["GET"])
|
self.add_endpoint("/update_software", "update_software", self.update_software, methods=["GET"])
|
||||||
@ -775,6 +773,7 @@ try:
|
|||||||
|
|
||||||
|
|
||||||
def list_voices(self):
|
def list_voices(self):
|
||||||
|
ASCIIColors.yellow("Listing voices")
|
||||||
voices=["main_voice"]
|
voices=["main_voice"]
|
||||||
voices_dir:Path=lollms_paths.custom_voices_path
|
voices_dir:Path=lollms_paths.custom_voices_path
|
||||||
voices += [v.stem for v in voices_dir.iterdir() if v.suffix==".wav"]
|
voices += [v.stem for v in voices_dir.iterdir() if v.suffix==".wav"]
|
||||||
@ -782,15 +781,15 @@ try:
|
|||||||
|
|
||||||
def set_voice(self):
|
def set_voice(self):
|
||||||
data = request.get_json()
|
data = request.get_json()
|
||||||
self.config.reading_voice=data["voice"]
|
self.config.current_voice=data["voice"]
|
||||||
if self.config.auto_save:
|
if self.config.auto_save:
|
||||||
self.config.save_config()
|
self.config.save_config()
|
||||||
return jsonify({"status":true})
|
return jsonify({"status":True})
|
||||||
|
|
||||||
def read(self):
|
def read(self):
|
||||||
# Get the JSON data from the POST request.
|
# Get the JSON data from the POST request.
|
||||||
data = request.get_json()
|
data = request.get_json()
|
||||||
voice=data.get("voice",self.config.reading_voice)
|
voice=data.get("voice",self.config.current_voice)
|
||||||
if voice is None:
|
if voice is None:
|
||||||
voice = "main_voice"
|
voice = "main_voice"
|
||||||
self.info("Starting to build voice")
|
self.info("Starting to build voice")
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# =================== Lord Of Large Language Models Configuration file ===========================
|
# =================== Lord Of Large Language Models Configuration file ===========================
|
||||||
version: 32
|
version: 33
|
||||||
binding_name: null
|
binding_name: null
|
||||||
model_name: null
|
model_name: null
|
||||||
|
|
||||||
@ -52,10 +52,11 @@ auto_show_browser: true
|
|||||||
# Audio
|
# Audio
|
||||||
media_on: false
|
media_on: false
|
||||||
audio_in_language: 'en-US'
|
audio_in_language: 'en-US'
|
||||||
audio_out_voice: null
|
|
||||||
auto_speak: false
|
auto_speak: false
|
||||||
auto_read: false
|
auto_read: false
|
||||||
reading_voice: null
|
enable_voice_service: false
|
||||||
|
audio_out_voice: null
|
||||||
|
current_voice: null
|
||||||
audio_pitch: 1
|
audio_pitch: 1
|
||||||
audio_auto_send_input: true
|
audio_auto_send_input: true
|
||||||
audio_silenceTimer: 5000
|
audio_silenceTimer: 5000
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 91093246d27c4c8ba98a718b8cae6ea0c8af6cfd
|
Subproject commit 1a49dd9dfc07c42c8329fc637274f7f4fc71dc36
|
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">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>LoLLMS WebUI - Welcome</title>
|
<title>LoLLMS WebUI - Welcome</title>
|
||||||
<script type="module" crossorigin src="/assets/index-eb3c4aa9.js"></script>
|
<script type="module" crossorigin src="/assets/index-dbbd1f94.js"></script>
|
||||||
<link rel="stylesheet" href="/assets/index-00b65516.css">
|
<link rel="stylesheet" href="/assets/index-a73bb544.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
|
@ -133,7 +133,7 @@
|
|||||||
<i data-feather="volume-2"></i>
|
<i data-feather="volume-2"></i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-row items-center">
|
<div v-if="enable_voice_service" class="flex flex-row items-center">
|
||||||
<div class="text-lg hover:text-red-600 duration-75 active:scale-90 p-2"
|
<div class="text-lg hover:text-red-600 duration-75 active:scale-90 p-2"
|
||||||
title="read"
|
title="read"
|
||||||
@click.stop="read()"
|
@click.stop="read()"
|
||||||
@ -544,6 +544,11 @@ export default {
|
|||||||
|
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
enable_voice_service:{
|
||||||
|
get(){
|
||||||
|
this.$store.state.config.enable_voice_service
|
||||||
|
}
|
||||||
|
},
|
||||||
editMsgMode:{
|
editMsgMode:{
|
||||||
get(){
|
get(){
|
||||||
if(this.message.hasOwnProperty('open'))
|
if(this.message.hasOwnProperty('open'))
|
||||||
|
@ -723,21 +723,55 @@
|
|||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="min-width: 200px;">
|
||||||
|
<label for="enable_voice_service" class="text-sm font-bold" style="margin-right: 1rem;">Enable voice service:</label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div class="flex flex-row">
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
id="enable_voice_service"
|
||||||
|
required
|
||||||
|
v-model="configFile.enable_voice_service"
|
||||||
|
@change="settingsChanged=true"
|
||||||
|
class="mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="min-width: 200px;">
|
||||||
|
<label for="current_voice" class="text-sm font-bold" style="margin-right: 1rem;">Current voice:</label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div class="flex flex-row">
|
||||||
|
<select v-model="current_voice" @change="settingsChanged=true" :disabled="!enable_voice_service">
|
||||||
|
<option v-for="voice in voices" :key="voice.id" :value="voice.id">
|
||||||
|
{{ voice }}
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td style="min-width: 200px;">
|
<td style="min-width: 200px;">
|
||||||
<label for="auto_read" class="text-sm font-bold" style="margin-right: 1rem;">Enable auto read:</label>
|
<label for="auto_read" class="text-sm font-bold" style="margin-right: 1rem;">Enable auto read:</label>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="flex flex-row">
|
<div class="flex flex-row">
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
id="auto_read"
|
id="auto_read"
|
||||||
required
|
required
|
||||||
v-model="configFile.auto_read"
|
v-model="configFile.auto_read"
|
||||||
@change="settingsChanged=true"
|
@change="settingsChanged=true"
|
||||||
class="mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
|
class="mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
|
||||||
>
|
:disabled="!enable_voice_service"
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -1818,6 +1852,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
voices: [],
|
||||||
binding_changed:false,
|
binding_changed:false,
|
||||||
SVGGPU:SVGGPU,
|
SVGGPU:SVGGPU,
|
||||||
models_zoo:[],
|
models_zoo:[],
|
||||||
@ -1909,6 +1944,15 @@ export default {
|
|||||||
//refreshHardwareUsage()
|
//refreshHardwareUsage()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getSeviceVoices() {
|
||||||
|
axios.get('list_voices')
|
||||||
|
.then(response => {
|
||||||
|
this.voices = response.data["voices"];
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error(error);
|
||||||
|
});
|
||||||
|
},
|
||||||
load_more_models(){
|
load_more_models(){
|
||||||
if(this.models_zoo_initialLoadCount+10<this.models_zoo.length){
|
if(this.models_zoo_initialLoadCount+10<this.models_zoo.length){
|
||||||
this.models_zoo_initialLoadCount+=10
|
this.models_zoo_initialLoadCount+=10
|
||||||
@ -3723,6 +3767,7 @@ export default {
|
|||||||
this.getVoices();
|
this.getVoices();
|
||||||
console.log("Constructing")
|
console.log("Constructing")
|
||||||
this.load_everything()
|
this.load_everything()
|
||||||
|
this.getSeviceVoices()
|
||||||
},
|
},
|
||||||
activated() {
|
activated() {
|
||||||
//this.load_everything()
|
//this.load_everything()
|
||||||
@ -3922,6 +3967,34 @@ export default {
|
|||||||
this.$store.state.config.auto_read = value
|
this.$store.state.config.auto_read = value
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
enable_voice_service:{
|
||||||
|
get() {
|
||||||
|
return this.$store.state.config.enable_voice_service;
|
||||||
|
},
|
||||||
|
set(value) {
|
||||||
|
// You should not set the value directly here; use the updateSetting method instead
|
||||||
|
this.$store.state.config.enable_voice_service = value
|
||||||
|
},
|
||||||
|
},
|
||||||
|
current_voice:{
|
||||||
|
get() {
|
||||||
|
if (this.$store.state.config.current_voice===null || this.$store.state.config.current_voice===undefined){
|
||||||
|
console.log("current voice", this.$store.state.config.current_voice)
|
||||||
|
return "main_voice";
|
||||||
|
}
|
||||||
|
return this.$store.state.config.current_voice;
|
||||||
|
},
|
||||||
|
set(value) {
|
||||||
|
// You should not set the value directly here; use the updateSetting method instead
|
||||||
|
if(value=="main_voice"){
|
||||||
|
this.$store.state.config.current_voice = null
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.$store.state.config.current_voice = value
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
audio_pitch:{
|
audio_pitch:{
|
||||||
get() {
|
get() {
|
||||||
return this.$store.state.config.audio_pitch;
|
return this.$store.state.config.audio_pitch;
|
||||||
@ -4130,13 +4203,11 @@ export default {
|
|||||||
|
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
watch: {
|
enable_voice_service(newValue) {
|
||||||
extensionsFiltered(newValue, oldValue) {
|
if (!newValue) {
|
||||||
// Perform any necessary UI updates here
|
this.configFile.auto_read = false;
|
||||||
// newValue represents the new value of extensionsFiltered
|
}
|
||||||
// oldValue represents the previous value of extensionsFiltered
|
},
|
||||||
}
|
|
||||||
},
|
|
||||||
bec_collapsed() {
|
bec_collapsed() {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
feather.replace()
|
feather.replace()
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit c98cb1098bd3d05049f557563b37fdb1ceebe8cc
|
Subproject commit 3dcfab2216f386ba558c508fa6f565593b740700
|
@ -1 +1 @@
|
|||||||
Subproject commit 3845762603dd7cabdba5d9b25ccc11b66c991d44
|
Subproject commit 6fd7581f87cb15ff00345106dca6b8e83e9d0256
|
Loading…
x
Reference in New Issue
Block a user