From 11f823bb8a9ced46874d8abe136ba77952265c30 Mon Sep 17 00:00:00 2001 From: Saifeddine ALOUI Date: Tue, 27 Feb 2024 13:03:09 +0100 Subject: [PATCH] fixed installation of modules --- lollms/services/motion_ctrl/lollms_motion_ctrl.py | 4 ++-- lollms/services/ollama/lollms_ollama.py | 4 ++-- lollms/services/petals/lollms_petals.py | 4 ++-- lollms/services/sd/lollms_sd.py | 6 +++--- lollms/services/vllm/lollms_vllm.py | 4 ++-- lollms/services/xtts/lollms_xtts.py | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lollms/services/motion_ctrl/lollms_motion_ctrl.py b/lollms/services/motion_ctrl/lollms_motion_ctrl.py index 458a05b..edae44b 100644 --- a/lollms/services/motion_ctrl/lollms_motion_ctrl.py +++ b/lollms/services/motion_ctrl/lollms_motion_ctrl.py @@ -11,7 +11,7 @@ import sys from lollms.app import LollmsApplication from lollms.paths import LollmsPaths from lollms.config import TypedConfig, ConfigTemplate, BaseConfig -from lollms.utilities import get_conda_path +from lollms.utilities import get_conda_path, show_yes_no_dialog import time import io import sys @@ -48,7 +48,7 @@ def install_motion_ctrl(lollms_app:LollmsApplication): shared_folder = root_dir/"shared" motion_ctrl_folder = shared_folder / "auto_motion_ctrl" if motion_ctrl_folder.exists(): - if not lollms_app.YesNoMessage("I have detected that there is a previous installation of stable diffusion.\nShould I remove it and continue installing?"): + if not show_yes_no_dialog("warning!","I have detected that there is a previous installation of motion ctrl.\nShould I remove it and continue installing?"): return else: motion_ctrl_folder.unlink(True) diff --git a/lollms/services/ollama/lollms_ollama.py b/lollms/services/ollama/lollms_ollama.py index dba52f3..250c538 100644 --- a/lollms/services/ollama/lollms_ollama.py +++ b/lollms/services/ollama/lollms_ollama.py @@ -28,7 +28,7 @@ from typing import List, Dict, Any from ascii_colors import ASCIIColors, trace_exception from lollms.paths import LollmsPaths -from lollms.utilities import git_pull +from lollms.utilities import git_pull, show_yes_no_dialog import subprocess import platform @@ -46,7 +46,7 @@ def install_ollama(lollms_app:LollmsApplication): if platform.system() == 'Windows': root_path = "/mnt/"+"".join(str(Path(__file__).parent).replace("\\","/").split(":")) if not os.path.exists('C:\\Windows\\System32\\wsl.exe'): - if not lollms_app.YesNoMessage("No WSL is detected on your system. Do you want me to install it for you? Ollama won't be abble to work without wsl."): + if not show_yes_no_dialog("warning!","No WSL is detected on your system. Do you want me to install it for you? Ollama won't be abble to work without wsl."): return False subprocess.run(['wsl', '--install', 'Ubuntu']) subprocess.run(['wsl', 'bash', '-c', 'cp {} ~'.format( root_path + '/install_ollama.sh')]) diff --git a/lollms/services/petals/lollms_petals.py b/lollms/services/petals/lollms_petals.py index d1f55e0..98ff4f1 100644 --- a/lollms/services/petals/lollms_petals.py +++ b/lollms/services/petals/lollms_petals.py @@ -29,7 +29,7 @@ from typing import List, Dict, Any from ascii_colors import ASCIIColors, trace_exception from lollms.paths import LollmsPaths -from lollms.utilities import git_pull +from lollms.utilities import git_pull, show_yes_no_dialog import subprocess import platform @@ -47,7 +47,7 @@ def install_petals(lollms_app:LollmsApplication): if platform.system() == 'Windows': root_path = "/mnt/"+"".join(str(Path(__file__).parent).replace("\\","/").split(":")) if not os.path.exists('C:\\Windows\\System32\\wsl.exe'): - if not lollms_app.YesNoMessage("No WSL is detected on your system. Do you want me to install it for you? petals won't be abble to work without wsl."): + if not show_yes_no_dialog("warning!","No WSL is detected on your system. Do you want me to install it for you? petals won't be abble to work without wsl."): return False subprocess.run(['wsl', '--install', 'Ubuntu']) subprocess.run(['wsl', 'bash', '-c', 'cp {} ~'.format( root_path + '/install_petals.sh')]) diff --git a/lollms/services/sd/lollms_sd.py b/lollms/services/sd/lollms_sd.py index 6c4aae5..1d3b9e2 100644 --- a/lollms/services/sd/lollms_sd.py +++ b/lollms/services/sd/lollms_sd.py @@ -28,7 +28,7 @@ from typing import List, Dict, Any from ascii_colors import ASCIIColors, trace_exception from lollms.paths import LollmsPaths -from lollms.utilities import git_pull +from lollms.utilities import git_pull, show_yes_no_dialog import subprocess @@ -52,13 +52,13 @@ def install_sd(lollms_app:LollmsApplication): shared_folder = root_dir/"shared" sd_folder = shared_folder / "auto_sd" if sd_folder.exists(): - if not lollms_app.YesNoMessage("I have detected that there is a previous installation of stable diffusion.\nShould I remove it and continue installing?"): + if not show_yes_no_dialog("warning!","I have detected that there is a previous installation of stable diffusion.\nShould I remove it and continue installing?"): return else: sd_folder.unlink(True) subprocess.run(["git", "clone", "https://github.com/ParisNeo/stable-diffusion-webui.git", str(sd_folder)]) subprocess.run(["git", "clone", "https://github.com/ParisNeo/SD-CN-Animation.git", str(sd_folder/"extensions/SD-CN-Animation")]) - if lollms_app.YesNoMessage("Do you want to install a model from civitai?\nIsuggest dreamshaper xl."): + if show_yes_no_dialog("warning!","Do you want to install a model from civitai?\nIsuggest dreamshaper xl."): download_file("https://civitai.com/api/download/models/351306", sd_folder/"models/Stable-diffusion","dreamshaperXL_v21TurboDPMSDE.safetensors") ASCIIColors.green("Stable diffusion installed successfully") diff --git a/lollms/services/vllm/lollms_vllm.py b/lollms/services/vllm/lollms_vllm.py index bc9d5c7..c979556 100644 --- a/lollms/services/vllm/lollms_vllm.py +++ b/lollms/services/vllm/lollms_vllm.py @@ -29,7 +29,7 @@ from typing import List, Dict, Any from ascii_colors import ASCIIColors, trace_exception from lollms.paths import LollmsPaths -from lollms.utilities import git_pull +from lollms.utilities import git_pull, show_yes_no_dialog import subprocess import platform @@ -48,7 +48,7 @@ def install_vllm(lollms_app:LollmsApplication): if platform.system() == 'Windows': root_path = "/mnt/"+"".join(str(Path(__file__).parent).replace("\\","/").split(":")) if not os.path.exists('C:\\Windows\\System32\\wsl.exe'): - if not lollms_app.YesNoMessage("No WSL is detected on your system. Do you want me to install it for you? vLLM won't be abble to work without wsl."): + if not show_yes_no_dialog("No WSL is detected on your system. Do you want me to install it for you? vLLM won't be abble to work without wsl."): return False subprocess.run(['wsl', '--install', 'Ubuntu']) subprocess.run(['wsl', 'bash', '-c', 'cp {} ~'.format( root_path + '/install_vllm.sh')]) diff --git a/lollms/services/xtts/lollms_xtts.py b/lollms/services/xtts/lollms_xtts.py index f862efe..a83f8b8 100644 --- a/lollms/services/xtts/lollms_xtts.py +++ b/lollms/services/xtts/lollms_xtts.py @@ -29,7 +29,7 @@ from typing import List, Dict, Any from ascii_colors import ASCIIColors, trace_exception from lollms.paths import LollmsPaths -from lollms.utilities import git_pull +from lollms.utilities import git_pull, show_yes_no_dialog import subprocess import platform @@ -45,7 +45,7 @@ def install_xtts(lollms_app:LollmsApplication): shared_folder = root_dir/"shared" xtts_folder = shared_folder / "xtts" if xtts_folder.exists() and PackageManager.check_package_installed("xtts-api-server"): - if not lollms_app.YesNoMessage("It looks like xtts is already installed on your system.\nDo you want to reinstall it?"): + if not show_yes_no_dialog("warning!","It looks like xtts is already installed on your system.\nDo you want to reinstall it?"): lollms_app.error("Service installation canceled") return