From 3540a8314585f684750cc96e7efc6eabcbd08a80 Mon Sep 17 00:00:00 2001 From: Saifeddine ALOUI Date: Thu, 11 Jan 2024 23:14:30 +0100 Subject: [PATCH] upgraded environments --- configs/config.yaml | 1 + endpoints/lollms_xtts.py | 2 +- lollms_core | 2 +- scripts/linux/linux_conda_session.sh | 20 +++--- scripts/linux/linux_install.sh | 11 ---- .../linux/linux_install_use_your_own_conda.sh | 17 ++++- scripts/linux/linux_run.sh | 20 +++--- scripts/linux/linux_update.sh | 43 ------------- scripts/linux/linux_update_models.sh | 63 ------------------- scripts/linux/uninstall.sh | 4 +- .../latex_execution_engine.py | 1 + web/src/views/SettingsView.vue | 19 +++++- zoos/personalities_zoo | 2 +- 13 files changed, 66 insertions(+), 139 deletions(-) delete mode 100644 scripts/linux/linux_update.sh delete mode 100644 scripts/linux/linux_update_models.sh diff --git a/configs/config.yaml b/configs/config.yaml index 8caeafda..93d9a1fd 100644 --- a/configs/config.yaml +++ b/configs/config.yaml @@ -98,3 +98,4 @@ pdf_latex_path: null positive_boost: null negative_boost: null force_output_language_to_be: null +fun_mode: False diff --git a/endpoints/lollms_xtts.py b/endpoints/lollms_xtts.py index 05f8a780..cc24b3e6 100644 --- a/endpoints/lollms_xtts.py +++ b/endpoints/lollms_xtts.py @@ -88,7 +88,7 @@ async def text2Audio(request: Request): if voice!="main_voice": voices_folder = lollmsElfServer.lollms_paths.custom_voices_path else: - voices_folder = Path(__file__).parent/"voices" + voices_folder = Path(__file__).parent.parent/"voices" lollmsElfServer.tts.set_speaker_folder(voices_folder) url = f"audio/{output_fn}" preprocessed_text= add_period(data['text']) diff --git a/lollms_core b/lollms_core index a5388d59..9aa7dbc1 160000 --- a/lollms_core +++ b/lollms_core @@ -1 +1 @@ -Subproject commit a5388d595190c79b0ee6057e4eea1e6135f7d8e8 +Subproject commit 9aa7dbc1f33432b6e38deb54db2bd2b03b0a477d diff --git a/scripts/linux/linux_conda_session.sh b/scripts/linux/linux_conda_session.sh index 7d5a6d0b..513b0fbe 100644 --- a/scripts/linux/linux_conda_session.sh +++ b/scripts/linux/linux_conda_session.sh @@ -21,17 +21,23 @@ CONDA_SHLVL="" PYTHONNOUSERSITE=1 PYTHONPATH="" PYTHONHOME="" -TEMP="./installer_files/temp" +miniconda_folder="./installer_files" TMP="./installer_files/temp" -INSTALL_ENV_DIR="./installer_files/lollms_env" -MINICONDA_DIR="./installer_files/miniconda3" -if [ ! -f "$MINICONDA_DIR/bin/activate" ]; then - echo "Miniconda not found." - exit 1 +if [ -e "$miniconda_folder" ]; then + INSTALL_ENV_DIR="./installer_files/lollms_env" + MINICONDA_DIR="./installer_files/miniconda3" + MINICONDA_CMD="$MINICONDA_DIR/bin/activate" + if [ ! -f "$MINICONDA_DIR/bin/activate" ]; then + echo "Miniconda not found." + exit 1 + fi +else + INSTALL_ENV_DIR="lollms" + MINICONDA_CMD="conda activate" fi -source "$MINICONDA_DIR/bin/activate" "$INSTALL_ENV_DIR" +source "$MINICONDA_CMD" "$INSTALL_ENV_DIR" read -rp "Conda environment activated" diff --git a/scripts/linux/linux_install.sh b/scripts/linux/linux_install.sh index 3ea9fe83..c257ae7c 100644 --- a/scripts/linux/linux_install.sh +++ b/scripts/linux/linux_install.sh @@ -134,11 +134,6 @@ else cp scripts/linux/linux_run.sh ../ fi -if [[ -e "../linux_update.sh" ]]; then - echo "Linux update found" -else - cp scripts/linux/linux_update.sh ../ -fi if [[ -e "../linux_conda_session.sh" ]]; then echo "Linux update found" @@ -146,12 +141,6 @@ else cp scripts/linux/linux_conda_session.sh ../ fi -if [[ -e "../linux_update_models.sh" ]]; then - echo "Linux update found" -else - cp scripts/linux/linux_update_models.sh ../ -fi - # cd scripts/python/lollms_installer # python main.py diff --git a/scripts/linux/linux_install_use_your_own_conda.sh b/scripts/linux/linux_install_use_your_own_conda.sh index ba0cd77b..2d3d12e2 100644 --- a/scripts/linux/linux_install_use_your_own_conda.sh +++ b/scripts/linux/linux_install_use_your_own_conda.sh @@ -67,8 +67,6 @@ else 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) @@ -82,6 +80,21 @@ done < requirements.txt # Install the pip requirements python -m pip install -r requirements.txt --upgrade +if [[ -e "../linux_run.sh" ]]; then + echo "Linux run found" +else + pwd + cp scripts/linux/linux_run.sh ../ +fi + +if [[ -e "../linux_conda_session.sh" ]]; then + echo "Linux update found" +else + pwd + cp scripts/linux/linux_conda_session.sh ../ +fi + + # cd scripts/python/lollms_installer # python main.py diff --git a/scripts/linux/linux_run.sh b/scripts/linux/linux_run.sh index cb4d160d..46c9069e 100644 --- a/scripts/linux/linux_run.sh +++ b/scripts/linux/linux_run.sh @@ -21,17 +21,23 @@ CONDA_SHLVL="" PYTHONNOUSERSITE=1 PYTHONPATH="" PYTHONHOME="" -TEMP="./installer_files/temp" +miniconda_folder="./installer_files" TMP="./installer_files/temp" -INSTALL_ENV_DIR="./installer_files/lollms_env" -MINICONDA_DIR="./installer_files/miniconda3" -if [ ! -f "$MINICONDA_DIR/bin/activate" ]; then - echo "Miniconda not found." - exit 1 +if [ -e "$miniconda_folder" ]; then + INSTALL_ENV_DIR="./installer_files/lollms_env" + MINICONDA_DIR="./installer_files/miniconda3" + MINICONDA_CMD="$MINICONDA_DIR/bin/activate" + if [ ! -f "$MINICONDA_DIR/bin/activate" ]; then + echo "Miniconda not found." + exit 1 + fi +else + INSTALL_ENV_DIR="lollms" + MINICONDA_CMD="conda activate" fi -source "$MINICONDA_DIR/bin/activate" "$INSTALL_ENV_DIR" +source "$MINICONDA_CMD" "$INSTALL_ENV_DIR" cd lollms-webui # set default cuda toolkit to the one in the environment diff --git a/scripts/linux/linux_update.sh b/scripts/linux/linux_update.sh deleted file mode 100644 index 2ab1c71c..00000000 --- a/scripts/linux/linux_update.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash -echo Starting LOLLMS Web UI... -echo " ___ ___ ___ ___ ___ ___ " -echo " /\__\ /\ \ /\__\ /\__\ /\__\ /\ \ " -echo " /:/ / /::\ \ /:/ / /:/ / /::| | /::\ \ " -echo " /:/ / /:/\:\ \ /:/ / /:/ / /:|:| | /:/\ \ \ " -echo " /:/ / /:/ \:\ \ /:/ / /:/ / /:/|:|__|__ _\:\~\ \ \ " -echo " /:/__/ /:/__/ \:\__\ /:/__/ /:/__/ /:/ |::::\__\ /\ \:\ \ \__\ " -echo " \:\ \ \:\ \ /:/ / \:\ \ \:\ \ \/__/~~/:/ / \:\ \:\ \/__/ " -echo " \:\ \ \:\ /:/ / \:\ \ \:\ \ /:/ / \:\ \:\__\ " -echo " \:\ \ \:\/:/ / \:\ \ \:\ \ /:/ / \:\/:/ / " -echo " \:\__\ \::/ / \:\__\ \:\__\ /:/ / \::/ / " -echo " \/__/ \/__/ \/__/ \/__/ \/__/ \/__/ " -echo " By ParisNeo" - - -cd "$(dirname "$0")" - -# better isolation for virtual environment -CONDA_SHLVL="" -PYTHONNOUSERSITE=1 -PYTHONPATH="" -PYTHONHOME="" -TEMP="./installer_files/temp" -TMP="./installer_files/temp" -INSTALL_ENV_DIR="./installer_files/lollms_env" -MINICONDA_DIR="./installer_files/miniconda3" - -if [ ! -f "$MINICONDA_DIR/bin/activate" ]; then - echo "Miniconda not found." - exit 1 -fi - -source "$MINICONDA_DIR/bin/activate" "$INSTALL_ENV_DIR" -cd lollms-webui - -echo Pulling latest changes -git pull - -echo Reinstalling requirements -pip install --upgrade -r requirements.txt - -pause diff --git a/scripts/linux/linux_update_models.sh b/scripts/linux/linux_update_models.sh deleted file mode 100644 index a8f5757a..00000000 --- a/scripts/linux/linux_update_models.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash -echo Starting LOLLMS Web UI... -echo " ___ ___ ___ ___ ___ ___ " -echo " /\__\ /\ \ /\__\ /\__\ /\__\ /\ \ " -echo " /:/ / /::\ \ /:/ / /:/ / /::| | /::\ \ " -echo " /:/ / /:/\:\ \ /:/ / /:/ / /:|:| | /:/\ \ \ " -echo " /:/ / /:/ \:\ \ /:/ / /:/ / /:/|:|__|__ _\:\~\ \ \ " -echo " /:/__/ /:/__/ \:\__\ /:/__/ /:/__/ /:/ |::::\__\ /\ \:\ \ \__\ " -echo " \:\ \ \:\ \ /:/ / \:\ \ \:\ \ \/__/~~/:/ / \:\ \:\ \/__/ " -echo " \:\ \ \:\ /:/ / \:\ \ \:\ \ /:/ / \:\ \:\__\ " -echo " \:\ \ \:\/:/ / \:\ \ \:\ \ /:/ / \:\/:/ / " -echo " \:\__\ \::/ / \:\__\ \:\__\ /:/ / \::/ / " -echo " \/__/ \/__/ \/__/ \/__/ \/__/ \/__/ " -echo " By ParisNeo" -echo " Models list update script" - -cd "$(dirname "$0")" - -# better isolation for virtual environment -CONDA_SHLVL="" -PYTHONNOUSERSITE=1 -PYTHONPATH="" -PYTHONHOME="" -TEMP="./installer_files/temp" -TMP="./installer_files/temp" -INSTALL_ENV_DIR="./installer_files/lollms_env" -MINICONDA_DIR="./installer_files/miniconda3" - -if [ ! -f "$MINICONDA_DIR/bin/activate" ]; then - echo "Miniconda not found." - exit 1 -fi - -source "$MINICONDA_DIR/bin/activate" "$INSTALL_ENV_DIR" - - -# Set your repository URL and file path -repository_url="https://github.com/ParisNeo/lollms_bindings_zoo.git" - -# Set the destination folder where the file will be downloaded -destination_folder="downloaded_files" - -# Create the destination folder if it doesn't exist -if [ ! -d "$destination_folder" ]; then - mkdir "$destination_folder" -fi - -# Clone the repository (if not already cloned) -if [ ! -d "$destination_folder/repository" ]; then - git clone "$repository_url" "$destination_folder/repository" -fi - -cd "$destination_folder/repository" - -echo "Updating models" -cp hugging_face/models.yaml ../../personal_data/bindings_zoo/hugging_face/models.yaml -cp c_transformers/models.yaml ../../personal_data/bindings_zoo/c_transformers/models.yaml -cp llama_cpp_official/models.yaml ../../personal_data/bindings_zoo/llama_cpp_official/models.yaml -cp gpt_4all/models.yaml ../../personal_data/bindings_zoo/gpt_4all/models.yaml -cp py_llama_cpp/models.yaml ../../personal_data/bindings_zoo/py_llama_cpp/models.yaml -cp gptq/models.yaml ../../personal_data/bindings_zoo/gptq/models.yaml -cp exllama/models.yaml ../../personal_data/bindings_zoo/exllama/models.yaml -echo "Updating models" diff --git a/scripts/linux/uninstall.sh b/scripts/linux/uninstall.sh index 2e5ef00e..872f696b 100644 --- a/scripts/linux/uninstall.sh +++ b/scripts/linux/uninstall.sh @@ -4,8 +4,8 @@ echo "This will uninstall the environment. Are you sure? [Y/N]" read choice if [[ "$choice" =~ [yY] ]]; then # Download Python installer - printf "Removing virtual environment..." - rm -rf env + printf "Removing lollms conda environment" + echo "OK" read -p "Press [Enter] to continue..." else diff --git a/utilities/execution_engines/latex_execution_engine.py b/utilities/execution_engines/latex_execution_engine.py index eb114ce5..6933234f 100644 --- a/utilities/execution_engines/latex_execution_engine.py +++ b/utilities/execution_engines/latex_execution_engine.py @@ -61,6 +61,7 @@ def execute_latex(code, discussion_id, message_id): except subprocess.CalledProcessError as ex: lollmsElfServer.error(f"Error occurred while compiling LaTeX: {ex}") + execution_time = time.time() - start_time error_json = {"output": "
"+str(ex)+"\n"+get_trace_exception(ex)+"
", "execution_time": execution_time} return error_json diff --git a/web/src/views/SettingsView.vue b/web/src/views/SettingsView.vue index 729ae5b8..c2b0c111 100644 --- a/web/src/views/SettingsView.vue +++ b/web/src/views/SettingsView.vue @@ -766,7 +766,24 @@ > - + + + + + + +
+ +
+ + diff --git a/zoos/personalities_zoo b/zoos/personalities_zoo index 0591f525..1bfd2121 160000 --- a/zoos/personalities_zoo +++ b/zoos/personalities_zoo @@ -1 +1 @@ -Subproject commit 0591f525d6fc86e93b34f812b06b8bf7dcbf3649 +Subproject commit 1bfd21219fea347efc3c90331e60c9f24efdc8c9