diff --git a/.gitmodules b/.gitmodules index 184bb043..7d35dcac 100644 --- a/.gitmodules +++ b/.gitmodules @@ -14,3 +14,11 @@ path = zoos/models_zoo url = https://github.com/ParisNeo/models_zoo.git branch = main +[submodule "lollms"] + path = lollms_core + url = https://github.com/ParisNeo/lollms.git + branch = main +[submodule "utilities/safe_store"] + path = utilities/safe_store + url = https://github.com/ParisNeo/safe_store.git + branch = main diff --git a/README.md b/README.md index 9519c2f5..cdd48d63 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,9 @@ [![Follow me on Twitter](https://img.shields.io/twitter/follow/SpaceNerduino?style=social)](https://twitter.com/SpaceNerduino) [![Follow Me on YouTube](https://img.shields.io/badge/Follow%20Me%20on-YouTube-red?style=flat&logo=youtube)](https://www.youtube.com/user/Parisneo) [![pages-build-deployment](https://github.com/ParisNeo/lollms-webui/actions/workflows/pages/pages-build-deployment/badge.svg)](https://github.com/ParisNeo/lollms-webui/actions/workflows/pages/pages-build-deployment) +[![Downloads](https://static.pepy.tech/badge/lollms-webui)](https://pepy.tech/project/lollms-webui) +[![Downloads](https://static.pepy.tech/badge/lollms-webui/month)](https://pepy.tech/project/lollms-webui) +[![Downloads](https://static.pepy.tech/badge/lollms-webui/week)](https://pepy.tech/project/lollms-webui) Welcome to LoLLMS WebUI (Lord of Large Language Models: One tool to rule them all), the hub for LLM (Large Language Model) models. This project aims to provide a user-friendly interface to access and utilize various LLM models for a wide range of tasks. Whether you need help with writing, coding, organizing data, generating images, generating music or seeking answers to your questions, LoLLMS WebUI has got you covered. diff --git a/api/__init__.py b/api/__init__.py index 434f6e0e..e637b262 100644 --- a/api/__init__.py +++ b/api/__init__.py @@ -117,8 +117,6 @@ class LoLLMsAPPI(LollmsApplication): super().__init__("Lollms_webui",config, lollms_paths, callback=self.process_chunk) - - self.busy = False self.nb_received_tokens = 0 @@ -956,7 +954,7 @@ class LoLLMsAPPI(LollmsApplication): if personality in loaded_names: mounted_personalities.append(loaded[loaded_names.index(personality)]) else: - personality_path = self.lollms_paths.personalities_zoo_path/f"{personality}" if not ":" in personality else self.lollms_paths.personalities_zoo_path/f"{personality.split(':')[0]}" + personality_path = f"{personality}" if not ":" in personality else f"{personality.split(':')[0]}" try: personality = AIPersonality(personality_path, self.lollms_paths, diff --git a/app.py b/app.py index 3a828eab..1c3783d4 100644 --- a/app.py +++ b/app.py @@ -1806,7 +1806,7 @@ class LoLLMsWebUI(LoLLMsAPPI): if self.config.auto_save: ASCIIColors.info("Saving configuration") self.config.save_config() - ASCIIColors.error(f"Personality {name} mounted successfully") + ASCIIColors.success(f"Personality {name} mounted successfully") return jsonify({"status": True, "personalities":self.config["personalities"], "active_personality_id":self.config["active_personality_id"] @@ -1896,7 +1896,10 @@ class LoLLMsWebUI(LoLLMsAPPI): else: self.personalities = ["generic/lollms"] self.mounted_personalities = self.rebuild_personalities() - self.personality = self.mounted_personalities[self.config["active_personality_id"]] + if self.config["active_personality_id"]nul -if %errorlevel% equ 0 ( - echo Internet Connection working fine - - REM Install Git - echo Checking for Git... - where git >nul 2>nul - if %errorlevel% equ 0 ( - echo Git is installed - ) else ( - set /p choice=Git is not installed. Would you like to install Git? [Y/N] - if /i "%choice%"=="Y" ( - echo Installing Git... - REM Replace the following two lines with appropriate Git installation commands for Windows - echo Please install Git and try again. - exit /b 1 - ) - ) - - REM Check if repository exists - if exist .git ( - echo Pulling latest changes - git pull - ) else ( - if exist lollms-webui ( - cd ./lollms-webui - ) else ( - echo Cloning repository... - git clone https://github.com/ParisNeo/lollms-webui.git ./lollms-webui - cd ./lollms-webui - echo Cloned successfully - ) - ) - - - echo Pulling latest version... - git pull - - REM Install Conda - echo Checking for Conda... - where conda >nul 2>nul - if %errorlevel% equ 0 ( - echo Conda is installed - ) else ( - set /p choice="Conda is not installed. Would you like to install Conda? [Y/N]:" - if /i "%choice%"=="Y" ( - echo Installing Conda... - set "miniconda_installer_url=https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe" - set "miniconda_installer=miniconda_installer_filename.exe" - rem Download the Miniconda installer using curl. - curl -o "%miniconda_installer%" "%miniconda_installer_url%" - if exist "%miniconda_installer%" ( - echo Miniconda installer downloaded successfully. - echo Installing Miniconda... - echo. - - rem Run the Miniconda installer. - "%miniconda_installer%" /InstallationType=JustMe /AddToPath=yes /RegisterPython=0 /S /D="%USERPROFILE%\Miniconda" - - if %errorlevel% equ 0 ( - echo Miniconda has been installed successfully in "%USERPROFILE%\Miniconda". - ) else ( - echo Failed to install Miniconda. - ) - - rem Clean up the Miniconda installer file. - del "%miniconda_installer%" - - rem Activate Miniconda. - call "%USERPROFILE%\Miniconda\Scripts\activate" - - ) else ( - echo Failed to download the Miniconda installer. - exit /b 1 - ) - ) - ) - echo Deactivating any activated environment - conda deactivate - - echo checking %environment_path% existance - - rem Check the error level to determine if the file exists - if not exist "%environment_path%" ( - REM Create a new Conda environment - echo Creating Conda environment... - conda create --prefix ./env python=3.10 - conda activate ./env - pip install --upgrade pip setuptools wheel - conda install -c conda-forge cudatoolkit-dev - ) else ( - echo Environment already exists. Skipping environment creation. - conda activate ./env - ) - - echo Activating environment - conda activate ./env - echo Conda environment is created - REM Install the required packages - echo Installing requirements using pip... - pip install -r requirements.txt - - if %errorlevel% neq 0 ( - echo Failed to install required packages. Please check your internet connection and try again. - exit /b 1 - ) - - echo Cleanup - REM Cleanup - if exist "./tmp" ( - echo Cleaning tmp folder - rmdir /s /q "./tmp" - echo Done - ) - echo Ready - echo launching app - REM Launch the Python application - python app.py %* - set app_result=%errorlevel% - - pause >nul - exit /b 0 - -) else ( - REM Go to webui folder - cd lollms-webui - - REM Activate environment - conda activate ./env - - echo launching app - REM Launch the Python application - python app.py %* - set app_result=%errorlevel% - - pause >nul - exit /b 0 -) - - diff --git a/scripts/windows/convert model.bat b/scripts/windows/convert model.bat deleted file mode 100644 index 4ad372f0..00000000 --- a/scripts/windows/convert model.bat +++ /dev/null @@ -1,13 +0,0 @@ -@echo off -@echo off -set filename=../models/%1 -set newname=../models/%1.original - -echo %modelPath% -echo Converting the model to the new format... -if not exist tmp\llama.cpp git clone https://github.com/ggerganov/llama.cpp.git tmp\llama.cpp -cd tmp\llama.cpp -cd ../.. -move /y "%filename%" "%newname%" -echo Converting ... -python tmp\llama.cpp\convert.py "%newname%" --outfile "%filename%" \ No newline at end of file diff --git a/scripts/windows/convert model_ggml.bat b/scripts/windows/convert model_ggml.bat deleted file mode 100644 index cde93c86..00000000 --- a/scripts/windows/convert model_ggml.bat +++ /dev/null @@ -1,12 +0,0 @@ -@echo off -REM put the model to ../models/alpaca as well as the tokenizer -set filename=../models/alpaca -set tokenizer=../models/alpaca/alpaca_tokenizer.model -echo %modelPath% -echo Converting the model to the new format... -if not exist tmp\llama.cpp git clone https://github.com/ggerganov/llama.cpp.git tmp\llama.cpp -cd tmp\llama.cpp -git checkout 6c248707f51c8a50f7792e7f7787ec481881db88 -cd ../.. -echo Converting ... -python tmp\llama.cpp\convert-lollms-to-ggml.py "%filename%" "%tokenizer%" \ No newline at end of file diff --git a/scripts/windows/convert model_with_tokenizer.bat b/scripts/windows/convert model_with_tokenizer.bat deleted file mode 100644 index bd1be9bc..00000000 --- a/scripts/windows/convert model_with_tokenizer.bat +++ /dev/null @@ -1,13 +0,0 @@ -@echo off -@echo off -set filename=../models/%1 -set newname=../models/%1.original - -echo %modelPath% -echo Converting the model to the new format... -if not exist tmp\llama.cpp git clone https://github.com/ggerganov/llama.cpp.git tmp\llama.cpp -cd tmp\llama.cpp -cd ../.. -move /y "%filename%" "%newname%" -echo Converting ... -python tmp\llama.cpp\convert.py "%newname%" --outfile "%filename%" --vocab-dir %2 \ No newline at end of file diff --git a/scripts/windows/win_install.bat b/scripts/windows/win_install.bat index c8396c47..c396ebbe 100644 --- a/scripts/windows/win_install.bat +++ b/scripts/windows/win_install.bat @@ -140,6 +140,14 @@ cd ../models_zoo git checkout main cd ../.. +cd ../lollms_core +git checkout main + +cd ../utilities/safe_store +git checkout main + +cd ../.. + @rem Loop through each "git+" requirement and uninstall it workaround for inconsistent git package updating for /F "delims=" %%a in (requirements.txt) do echo "%%a"| findstr /C:"git+" >nul&& for /F "tokens=4 delims=/" %%b in ("%%a") do for /F "delims=@" %%c in ("%%b") do python -m pip uninstall -y %%c @@ -147,6 +155,13 @@ for /F "delims=" %%a in (requirements.txt) do echo "%%a"| findstr /C:"git+" >nul @rem install the pip requirements call python -m pip install -r requirements.txt --upgrade +@rem install the pip requirements +call python -m pip install -e lollms_core --upgrade + +@rem install the pip requirements +call python -m pip install -e utilities/safe_store --upgrade + + @rem create launcher if exist ..\win_run.bat ( echo Win run found diff --git a/utilities/safe_store b/utilities/safe_store new file mode 160000 index 00000000..d7e54b24 --- /dev/null +++ b/utilities/safe_store @@ -0,0 +1 @@ +Subproject commit d7e54b2404595d4f6314cdd42e399c5fe6c9af1e diff --git a/web/src/components/ChatBox.vue b/web/src/components/ChatBox.vue index a15adccd..5f49e72c 100644 --- a/web/src/components/ChatBox.vue +++ b/web/src/components/ChatBox.vue @@ -485,6 +485,7 @@ export default { onUnmountFun(comp) { console.log('Unmounting personality') this.$refs.mountedPers.constructor() + }, onRemount(comp){ console.log('Remounting chat') diff --git a/web/src/components/MarkdownRenderer.vue b/web/src/components/MarkdownRenderer.vue index 4eddb404..216f3b73 100644 --- a/web/src/components/MarkdownRenderer.vue +++ b/web/src/components/MarkdownRenderer.vue @@ -38,14 +38,14 @@ const markdownIt = new MarkdownIt('commonmark', { let discussion_id = 0 let message_id = 0 - let btn_exec_txt = (lang=='python' || lang=='bash') ?'':'' - let btn_open_in_vs_code_txt = (lang=='python' || lang=='bash') ?'':'' - let btn_open_folder_txt = (lang=='python' || lang=='bash') ?'