This commit is contained in:
Saifeddine ALOUI 2024-01-04 22:33:43 +01:00
parent c44ff99d7b
commit 2340601e85
10 changed files with 500 additions and 344 deletions

9
app.py
View File

@ -303,6 +303,7 @@ try:
self.add_endpoint("/unmount_personality", "unmount_personality", self.p_unmount_personality, methods=["POST"])
self.add_endpoint("/unmount_all_personalities", "unmount_all_personalities", self.unmount_all_personalities, methods=["GET"])
self.add_endpoint("/select_personality", "select_personality", self.p_select_personality, methods=["POST"])
self.add_endpoint("/get_personality_settings", "get_personality_settings", self.get_personality_settings, methods=["POST"])
@ -2142,6 +2143,14 @@ try:
ASCIIColors.yellow(f"Available personalities: {[p.name for p in self.mounted_personalities]}")
return jsonify({"status": False, "error":f"Personality not found @ {pth}"})
def unmount_all_personalities(self):
self.config.personalities=["generic/lollms"]
self.mounted_personalities=[]
self.personality=None
self.mount_personality(0)
self.config.save_config()
return jsonify({"status":True})
def p_unmount_personality(self):
print("- Unmounting personality ...")
try:

View File

@ -0,0 +1,102 @@
#!/bin/bash
# This script will install miniconda and git with all dependencies for this project
# This enables a user to install this project without manually installing conda and git.
echo " ___ ___ ___ ___ ___ ___ "
echo " /\__\ /\ \ /\__\ /\__\ /\__\ /\ \ "
echo " /:/ / /::\ \ /:/ / /:/ / /::| | /::\ \ "
echo " /:/ / /:/\:\ \ /:/ / /:/ / /:|:| | /:/\ \ \ "
echo " /:/ / /:/ \:\ \ /:/ / /:/ / /:/|:|__|__ _\:\~\ \ \ "
echo " /:/__/ /:/__/ \:\__\ /:/__/ /:/__/ /:/ |::::\__\ /\ \:\ \ \__\ "
echo " \:\ \ \:\ \ /:/ / \:\ \ \:\ \ \/__/~~/:/ / \:\ \:\ \/__/ "
echo " \:\ \ \:\ /:/ / \:\ \ \:\ \ /:/ / \:\ \:\__\ "
echo " \:\ \ \:\/:/ / \:\ \ \:\ \ /:/ / \:\/:/ / "
echo " \:\__\ \::/ / \:\__\ \:\__\ /:/ / \::/ / "
echo " \/__/ \/__/ \/__/ \/__/ \/__/ \/__/ "
echo "V8.5 (alpha)"
echo "-----------------"
echo "By ParisNeo"
echo "-----------------"
cd "$(dirname "$0")"
echo "This script is for users who already have conda installed on their system. If you have conda installed on your system then press enter to continue. If you don't have conda, please exit this script, install conda then restart it. You can also use the other linux install script that will install miniconda for you."
export PACKAGES_TO_INSTALL="python=3.11 git pip"
read -rp "Press Enter to continue..."
clear
# Better isolation for virtual environment
unset CONDA_SHLVL
export PYTHONNOUSERSITE=1
unset PYTHONPATH
unset PYTHONHOME
REPO_URL="https://github.com/ParisNeo/lollms-webui.git"
conda create --name lollms $PACKAGES_TO_INSTALL -y
# Activate installer environment
conda activate lollms || ( echo && echo "Conda environment activation failed." && exit 1 )
# Clone the repository
if [ -d "lollms-webui" ]; then
cd lollms-webui || exit 1
git pull
git submodule update --init --recursive
cd
cd lollms-core
pip install -e .
cd ..
cd utilities/safe_store
pip install -e .
cd ../..
else
git clone --depth 1 --recurse-submodules "$REPO_URL"
git submodule update --init --recursive
cd lollms-webui/lollms_core
pip install -e .
cd ..
cd utilities/safe_store
pip install -e .
cd ../..
cd lollms-webui || exit 1
fi
# Loop through each "git+" requirement and uninstall it (workaround for inconsistent git package updating)
while IFS= read -r requirement; do
if echo "$requirement" | grep -q "git+"; then
package_name=$(echo "$requirement" | awk -F'/' '{ print $4 }' | awk -F'@' '{ print $1 }')
python -m pip uninstall -y "$package_name"
fi
done < requirements.txt
# Install the pip requirements
python -m pip install -r requirements.txt --upgrade
cd scripts/python/lollms_installer
python main.py
cd ..
PrintBigMessage() {
echo
echo "*******************************************************************"
for message in "$@"; do
echo "* $message"
done
echo "*******************************************************************"
echo
}
PrintBigMessage "$@"
exit 0

View File

@ -75,10 +75,21 @@ if [ ! -f "$MINICONDA_DIR/Scripts/conda" ]; then
echo "Installing Miniconda to $MINICONDA_DIR"
echo "Please wait..."
echo
bash "Miniconda3-latest-MacOSX-x86_64.sh" -b -p "$MINICONDA_DIR" || ( echo && echo "Miniconda installer not found." && exit 1 )
rm -f "Miniconda3-latest-MacOSX-x86_64.sh"
if [ ! -f "$MINICONDA_DIR/bin/activate" ]; then
echo && echo "Miniconda install failed." && exit 1
if [ "$arch" == "arm64" ]; then
bash "Miniforge3-MacOSX-arm64.sh" -b -p "$MINICONDA_DIR" || ( echo && echo "Miniconda installer not found." && exit 1 )
rm -f "Miniforge3-MacOSX-arm64.sh"
if [ ! -f "$MINICONDA_DIR/bin/activate" ]; then
echo && echo "Miniconda install failed." && exit 1
fi
else
bash "Miniconda3-latest-MacOSX-x86_64.sh" -b -p "$MINICONDA_DIR" || ( echo && echo "Miniconda installer not found." && exit 1 )
rm -f "Miniconda3-latest-MacOSX-x86_64.sh"
if [ ! -f "$MINICONDA_DIR/bin/activate" ]; then
echo && echo "Miniconda install failed." && exit 1
fi
fi
fi

File diff suppressed because one or more lines are too long

8
web/dist/assets/index-a602330a.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-33cdc340.js"></script>
<link rel="stylesheet" href="/assets/index-a8faae1b.css">
<script type="module" crossorigin src="/assets/index-38c774e3.js"></script>
<link rel="stylesheet" href="/assets/index-a602330a.css">
</head>
<body>
<div id="app"></div>

View File

@ -209,8 +209,6 @@
</div>
</div>
<!-- MAIN CONFIGS -->
<div
class="flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg">
@ -772,151 +770,6 @@
</table>
</Card>
<Card title="Stable diffusion service" :is_subcard="true" class="pb-2 m-2">
<table 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">
<tr>
<td style="min-width: 200px;">
<label for="enable_sd_service" class="text-sm font-bold" style="margin-right: 1rem;">Enable sd service:</label>
</td>
<td>
<div class="flex flex-row">
<input
type="checkbox"
id="enable_sd_service"
required
v-model="configFile.enable_sd_service"
@change="settingsChanged=true"
class="mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
>
</div>
</td>
</tr>
<tr>
<td style="min-width: 200px;">
<label for="install_sd_service" class="text-sm font-bold" style="margin-right: 1rem;">Reinstall SD service:</label>
</td>
<td>
<div class="flex flex-row">
<button class="hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center" @click="reinstallSDService">Reinstall sd service</button>
</div>
</td>
</tr>
<tr>
<td style="min-width: 200px;">
<label for="sd_base_url" class="text-sm font-bold" style="margin-right: 1rem;">sd base url:</label>
</td>
<td>
<div class="flex flex-row">
<input
type="text"
id="sd_base_url"
required
v-model="configFile.sd_base_url"
@change="settingsChanged=true"
class="mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
>
</div>
</td>
</tr>
</table>
</Card>
<Card title="XTTS service" :is_subcard="true" class="pb-2 m-2">
<table 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">
<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>
<td style="min-width: 200px;">
<label for="install_xtts_service" class="text-sm font-bold" style="margin-right: 1rem;">Reinstall xTTS service:</label>
</td>
<td>
<div class="flex flex-row">
<button class="hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center" @click="reinstallAudioService">Reinstall xtts service</button>
</div>
</td>
</tr>
<tr>
<td style="min-width: 200px;">
<label for="xtts_base_url" class="text-sm font-bold" style="margin-right: 1rem;">xtts base url:</label>
</td>
<td>
<div class="flex flex-row">
<input
type="text"
id="xtts_base_url"
required
v-model="configFile.xtts_base_url"
@change="settingsChanged=true"
class="mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
>
</div>
</td>
</tr>
<tr>
<td style="min-width: 200px;">
<label for="current_language" class="text-sm font-bold" style="margin-right: 1rem;">Current language:</label>
</td>
<td>
<div class="flex flex-row">
<select v-model="current_language" @change="settingsChanged=true" :disabled="!enable_voice_service">
<option v-for="(value, key) in voice_languages" :key="key" :value="value">
{{ key }}
</option>
</select>
</div>
</td>
</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" :value="voice">
{{ voice }}
</option>
</select>
</div>
</td>
</tr>
<tr>
<td style="min-width: 200px;">
<label for="auto_read" class="text-sm font-bold" style="margin-right: 1rem;">Enable auto read:</label>
</td>
<td>
<div class="flex flex-row">
<input
type="checkbox"
id="auto_read"
required
v-model="configFile.auto_read"
@change="settingsChanged=true"
class="mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
:disabled="!enable_voice_service"
>
</div>
</td>
</tr>
</table>
</Card>
<Card title="Browser Audio" :is_subcard="true" class="pb-2 m-2">
<table 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">
@ -1039,7 +892,168 @@
</div>
</div>
<!-- Servers CONFIGS -->
<div
class="flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg">
<div class="flex flex-row p-3">
<button @click.stop="servers_conf_collapsed = !servers_conf_collapsed"
class="text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center">
<div v-show="servers_conf_collapsed" ><i data-feather='chevron-right'></i></div>
<div v-show="!servers_conf_collapsed" ><i data-feather='chevron-down'></i></div>
<h3 class="text-lg font-semibold cursor-pointer select-none mr-2">
Servers configurations</h3>
</button>
</div>
<div :class="{ 'hidden': servers_conf_collapsed }" class="flex flex-col mb-2 px-3 pb-0">
<Card title="Stable diffusion service" :is_subcard="true" class="pb-2 m-2">
<table 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">
<tr>
<td style="min-width: 200px;">
<label for="enable_sd_service" class="text-sm font-bold" style="margin-right: 1rem;">Enable sd service:</label>
</td>
<td>
<div class="flex flex-row">
<input
type="checkbox"
id="enable_sd_service"
required
v-model="configFile.enable_sd_service"
@change="settingsChanged=true"
class="mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
>
</div>
</td>
</tr>
<tr>
<td style="min-width: 200px;">
<label for="install_sd_service" class="text-sm font-bold" style="margin-right: 1rem;">Reinstall SD service:</label>
</td>
<td>
<div class="flex flex-row">
<button class="hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center" @click="reinstallSDService">Reinstall sd service</button>
</div>
</td>
</tr>
<tr>
<td style="min-width: 200px;">
<label for="sd_base_url" class="text-sm font-bold" style="margin-right: 1rem;">sd base url:</label>
</td>
<td>
<div class="flex flex-row">
<input
type="text"
id="sd_base_url"
required
v-model="configFile.sd_base_url"
@change="settingsChanged=true"
class="mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
>
</div>
</td>
</tr>
</table>
</Card>
<Card title="XTTS service" :is_subcard="true" class="pb-2 m-2">
<table 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">
<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>
<td style="min-width: 200px;">
<label for="install_xtts_service" class="text-sm font-bold" style="margin-right: 1rem;">Reinstall xTTS service:</label>
</td>
<td>
<div class="flex flex-row">
<button class="hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center" @click="reinstallAudioService">Reinstall xtts service</button>
</div>
</td>
</tr>
<tr>
<td style="min-width: 200px;">
<label for="xtts_base_url" class="text-sm font-bold" style="margin-right: 1rem;">xtts base url:</label>
</td>
<td>
<div class="flex flex-row">
<input
type="text"
id="xtts_base_url"
required
v-model="configFile.xtts_base_url"
@change="settingsChanged=true"
class="mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
>
</div>
</td>
</tr>
<tr>
<td style="min-width: 200px;">
<label for="current_language" class="text-sm font-bold" style="margin-right: 1rem;">Current language:</label>
</td>
<td>
<div class="flex flex-row">
<select v-model="current_language" @change="settingsChanged=true" :disabled="!enable_voice_service">
<option v-for="(value, key) in voice_languages" :key="key" :value="value">
{{ key }}
</option>
</select>
</div>
</td>
</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" :value="voice">
{{ voice }}
</option>
</select>
</div>
</td>
</tr>
<tr>
<td style="min-width: 200px;">
<label for="auto_read" class="text-sm font-bold" style="margin-right: 1rem;">Enable auto read:</label>
</td>
<td>
<div class="flex flex-row">
<input
type="checkbox"
id="auto_read"
required
v-model="configFile.auto_read"
@change="settingsChanged=true"
class="mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
:disabled="!enable_voice_service"
>
</div>
</td>
</tr>
</table>
</Card>
</div>
</div>
<!-- BINDING ZOO -->
@ -1420,7 +1434,6 @@
:title="item.name">
</button>
<button @click.stop="unmountPersonality (item)">
<span
class="hidden group-hover:block top-0 left-7 absolute active:scale-90 bg-bg-light dark:bg-bg-dark rounded-full border-2 border-transparent"
title="Unmount personality">
@ -1440,6 +1453,20 @@
</div>
</div>
<button
@click.stop="unmountAll()"
class="bg-bg-light hover:border-green-200 ml-5 dark:bg-bg-dark rounded-full border-2 border-transparent"
title="Unmount All"
>
<!-- UNMOUNT BUTTON -->
<svg aria-hidden="true" class="w-4 h-4 text-red-600 hover:text-red-500 "
fill="currentColor" viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd"
d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"
clip-rule="evenodd"></path>
</svg>
</button>
</button>
</div>
<div :class="{ 'hidden': pzc_collapsed }" class="flex flex-col mb-2 px-3 pb-0">
@ -2089,6 +2116,7 @@ export default {
// Accordeon stuff
collapsedArr: [],
all_collapsed: true,
servers_conf_collapsed: true, // Servers configuration
minconf_collapsed: true, // Main configuration
bec_collapsed: true,
sort_type : 0, // 0: by date, 1: by rank, 2: by name, 3: by maker, 4: by quantizer
@ -2506,6 +2534,7 @@ export default {
this.addModelDialogVisibility = false;
},
collapseAll(val) {
this.servers_conf_collapsed = val
this.minconf_collapsed = val
this.bec_collapsed = val
this.mzc_collapsed = val
@ -3763,6 +3792,11 @@ export default {
this.isLoading = false
},
async unmountAll(){
await axios.get('/unmount_all_personalities');
this.$store.dispatch('refreshMountedPersonalities');
this.$store.state.toast.showToast("All personas unmounted", 4, true)
},
async unmountPersonality(pers) {
this.isLoading = true
if (!pers) { return }

@ -1 +1 @@
Subproject commit 8cd157246b27401a61cf226dfefa4e25fda519a9
Subproject commit 4f7a8d134a201d209d8d31394ae7af04b9981e4b

@ -1 +1 @@
Subproject commit f8ba27ca727f905618bc044ab45f62889e41b668
Subproject commit 13392fa155326de95e42f2106c4b371f81057d1d