From 0a851fe8c17178c4f8b975beaf4cfec8e6b1e883 Mon Sep 17 00:00:00 2001 From: AndzejsP Date: Tue, 18 Apr 2023 13:05:16 +0300 Subject: [PATCH 01/12] starting to work on the .sh --- webui-a11.sh | 186 +++++++++++++++++++++++++++++++++++++++++++++++++++ webui.sh | 38 +++++++++++ 2 files changed, 224 insertions(+) create mode 100644 webui-a11.sh create mode 100644 webui.sh diff --git a/webui-a11.sh b/webui-a11.sh new file mode 100644 index 00000000..8cdad22d --- /dev/null +++ b/webui-a11.sh @@ -0,0 +1,186 @@ +#!/usr/bin/env bash +################################################# +# Please do not make any changes to this file, # +# change the variables in webui-user.sh instead # +################################################# + +# If run from macOS, load defaults from webui-macos-env.sh +if [[ "$OSTYPE" == "darwin"* ]]; then + if [[ -f webui-macos-env.sh ]] + then + source ./webui-macos-env.sh + fi +fi + +# Read variables from webui-user.sh +# shellcheck source=/dev/null +if [[ -f webui-user.sh ]] +then + source ./webui-user.sh +fi + +# Set defaults +# Install directory without trailing slash +if [[ -z "${install_dir}" ]] +then + install_dir="/home/$(whoami)" +fi + +# Name of the subdirectory (defaults to stable-diffusion-webui) +if [[ -z "${clone_dir}" ]] +then + clone_dir="stable-diffusion-webui" +fi + +# python3 executable +if [[ -z "${python_cmd}" ]] +then + python_cmd="python3" +fi + +# git executable +if [[ -z "${GIT}" ]] +then + export GIT="git" +fi + +# python3 venv without trailing slash (defaults to ${install_dir}/${clone_dir}/venv) +if [[ -z "${venv_dir}" ]] +then + venv_dir="venv" +fi + +if [[ -z "${LAUNCH_SCRIPT}" ]] +then + LAUNCH_SCRIPT="launch.py" +fi + +# this script cannot be run as root by default +can_run_as_root=0 + +# read any command line flags to the webui.sh script +while getopts "f" flag > /dev/null 2>&1 +do + case ${flag} in + f) can_run_as_root=1;; + *) break;; + esac +done + +# Disable sentry logging +export ERROR_REPORTING=FALSE + +# Do not reinstall existing pip packages on Debian/Ubuntu +export PIP_IGNORE_INSTALLED=0 + +# Pretty print +delimiter="################################################################" + +printf "\n%s\n" "${delimiter}" +printf "\e[1m\e[32mInstall script for stable-diffusion + Web UI\n" +printf "\e[1m\e[34mTested on Debian 11 (Bullseye)\e[0m" +printf "\n%s\n" "${delimiter}" + +# Do not run as root +if [[ $(id -u) -eq 0 && can_run_as_root -eq 0 ]] +then + printf "\n%s\n" "${delimiter}" + printf "\e[1m\e[31mERROR: This script must not be launched as root, aborting...\e[0m" + printf "\n%s\n" "${delimiter}" + exit 1 +else + printf "\n%s\n" "${delimiter}" + printf "Running on \e[1m\e[32m%s\e[0m user" "$(whoami)" + printf "\n%s\n" "${delimiter}" +fi + +if [[ -d .git ]] +then + printf "\n%s\n" "${delimiter}" + printf "Repo already cloned, using it as install directory" + printf "\n%s\n" "${delimiter}" + install_dir="${PWD}/../" + clone_dir="${PWD##*/}" +fi + +# Check prerequisites +gpu_info=$(lspci 2>/dev/null | grep VGA) +case "$gpu_info" in + *"Navi 1"*|*"Navi 2"*) export HSA_OVERRIDE_GFX_VERSION=10.3.0 + ;; + *"Renoir"*) export HSA_OVERRIDE_GFX_VERSION=9.0.0 + printf "\n%s\n" "${delimiter}" + printf "Experimental support for Renoir: make sure to have at least 4GB of VRAM and 10GB of RAM or enable cpu mode: --use-cpu all --no-half" + printf "\n%s\n" "${delimiter}" + ;; + *) + ;; +esac +if echo "$gpu_info" | grep -q "AMD" && [[ -z "${TORCH_COMMAND}" ]] +then + export TORCH_COMMAND="pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/rocm5.2" +fi + +for preq in "${GIT}" "${python_cmd}" +do + if ! hash "${preq}" &>/dev/null + then + printf "\n%s\n" "${delimiter}" + printf "\e[1m\e[31mERROR: %s is not installed, aborting...\e[0m" "${preq}" + printf "\n%s\n" "${delimiter}" + exit 1 + fi +done + +if ! "${python_cmd}" -c "import venv" &>/dev/null +then + printf "\n%s\n" "${delimiter}" + printf "\e[1m\e[31mERROR: python3-venv is not installed, aborting...\e[0m" + printf "\n%s\n" "${delimiter}" + exit 1 +fi + +cd "${install_dir}"/ || { printf "\e[1m\e[31mERROR: Can't cd to %s/, aborting...\e[0m" "${install_dir}"; exit 1; } +if [[ -d "${clone_dir}" ]] +then + cd "${clone_dir}"/ || { printf "\e[1m\e[31mERROR: Can't cd to %s/%s/, aborting...\e[0m" "${install_dir}" "${clone_dir}"; exit 1; } +else + printf "\n%s\n" "${delimiter}" + printf "Clone stable-diffusion-webui" + printf "\n%s\n" "${delimiter}" + "${GIT}" clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git "${clone_dir}" + cd "${clone_dir}"/ || { printf "\e[1m\e[31mERROR: Can't cd to %s/%s/, aborting...\e[0m" "${install_dir}" "${clone_dir}"; exit 1; } +fi + +printf "\n%s\n" "${delimiter}" +printf "Create and activate python venv" +printf "\n%s\n" "${delimiter}" +cd "${install_dir}"/"${clone_dir}"/ || { printf "\e[1m\e[31mERROR: Can't cd to %s/%s/, aborting...\e[0m" "${install_dir}" "${clone_dir}"; exit 1; } +if [[ ! -d "${venv_dir}" ]] +then + "${python_cmd}" -m venv "${venv_dir}" + first_launch=1 +fi +# shellcheck source=/dev/null +if [[ -f "${venv_dir}"/bin/activate ]] +then + source "${venv_dir}"/bin/activate +else + printf "\n%s\n" "${delimiter}" + printf "\e[1m\e[31mERROR: Cannot activate python venv, aborting...\e[0m" + printf "\n%s\n" "${delimiter}" + exit 1 +fi + +if [[ ! -z "${ACCELERATE}" ]] && [ ${ACCELERATE}="True" ] && [ -x "$(command -v accelerate)" ] +then + printf "\n%s\n" "${delimiter}" + printf "Accelerating launch.py..." + printf "\n%s\n" "${delimiter}" + exec accelerate launch --num_cpu_threads_per_process=6 "${LAUNCH_SCRIPT}" "$@" +else + printf "\n%s\n" "${delimiter}" + printf "Launching launch.py..." + printf "\n%s\n" "${delimiter}" + exec "${python_cmd}" "${LAUNCH_SCRIPT}" "$@" +fi diff --git a/webui.sh b/webui.sh new file mode 100644 index 00000000..e0aca3ba --- /dev/null +++ b/webui.sh @@ -0,0 +1,38 @@ +#!/usr/bin/bash + +echo "HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH" +echo "HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH" +echo "HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH" +echo "HHHHHHHHHHHH .HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH" +echo "HHHHHHHHHHH. ,HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH" +echo "HHHHHHHHHHHHH.## HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH" +echo "HHHHHHHHHHHHHHHHHHH#.HHHHH/*,*,*,*,*,*,*,*,***,*,**#HHHHHHHHHHHHHHHHHHHHHHHHHHHH" +echo "HHHHHHHHHHHHHHHHHHHHH.*,,***,***,***,***,***,***,*******HHHHHHHHHHHHHHHHHHHHHHHH" +echo "HHHHHHHHHHHHHHHHHHH*,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,*,,,,,HHHHHHHHHHHHHHHHHHHHH" +echo "HHHHHHHHHHHHHHHHH.,,,***,***,***,***,***,***,***,***,***,***/HHHHHHHHHHHHHHHHHHH" +echo "HHHHHHHHHHHHHHHH*,,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*HHHHHHHHHHHHHHHHHH" +echo "HHHHHHHHHHHHHHH#,***,***,***,***,***,***,***,***,***,***,***,**HHHHHHHHHHHHHHHHH" +echo "HHHHHHHHHH..HHH,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,*#HHHHHHHHHHHHHHHH" +echo "HHHHHHH,,,**,/H*,***,***,***,,,*,***,***,***,**,,,**,***,***,***H,,*,***HHHHHHHH" +echo "HHHHHH.*,,,*,,,,,*,*,*,***#HHHHH.,,*,*,*,*,**/HHHHH.,*,*,*,*,*,*,*,*****HHHHHHHH" +echo "HHHHHH.*,***,*,*,***,***,.HHHHHHH/**,***,****HHHHHHH.***,***,***,*******HHHHHHHH" +echo "HHHHHH.,,,,,,,,,,,,,,,,,,,.HHHHH.,,,,,,,,,,,,.HHHHHH,,,,,,,,,,,,,,,,,***HHHHHHHH" +echo "HHHHHH.,,,,,,/H,,,**,***,***,,,*,***,***,***,**,,,,*,***,***,***H***,***HHHHHHHH" +echo "HHHHHHH.,,,,*.H,,,,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,***H*,,,,/HHHHHHHHH" +echo "HHHHHHHHHHHHHHH*,***,***,**,,***,***,***,***,***,***,***,***,**.HHHHHHHHHHHHHHHH" +echo "HHHHHHHHHHHHHHHH,,,,,,,,*,,#H#,,,,,*,,,*,,,,,,,,*#H*,,,,,,,,,**HHHHHHHHHHHHHHHHH" +echo "HHHHHHHHHHHHHHHHH,,*,***,***,**/.HHHHHHHHHHHHH#*,,,*,***,***,*HHHHHHHHHHHHHHHHHH" +echo "HHHHHHHHHHHHHHHHHH,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*HHHHHHHHHHHHHHHHHH" +echo "HHHHHHHHHHHHHHHHHH**,***,***,***,***,***,***,***,***,***,***,*.HHHHHHHHHHHHHHHHH" +echo "HHHHHHHHHHHHHHHHHH*,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,*HHHHHHHHHHHHHHHHH" +echo "HHHHHHHHHHHHHHHHHH**,***,***,*******/..HHHHHHHHH.#/*,*,,,***,***HHHHHHHHHHHHHHHH" +echo "HHHHHHHHHHHHHHHHH*,*,*,******#HHHHHHHHHHHHHHHHHHHHHHHHHHHH./**,,,.HHHHHHHHHHHHHH" +echo "HHHHHHHHHHHHHHHH.,,*,***.HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH.*#HHHHHHHHHHHH" +echo "HHHHHHHHHHHHHHH/,,,*.HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH" +echo "HHHHHHHHHHHHHH,,#HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH" +echo "HHHHHHHHHHHH.HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH" +echo "HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH" +echo "HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH" +echo "HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH" + + From 8bfad7002f619772a5164f2a98d1bb988f641295 Mon Sep 17 00:00:00 2001 From: andzejsp Date: Tue, 18 Apr 2023 17:54:19 +0300 Subject: [PATCH 02/12] more work --- tmpllama.cpp | 1 + webui.sh | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 160000 tmpllama.cpp diff --git a/tmpllama.cpp b/tmpllama.cpp new file mode 160000 index 00000000..42747220 --- /dev/null +++ b/tmpllama.cpp @@ -0,0 +1 @@ +Subproject commit 42747220b4cac548b6e3059b66b3e960b517cfa4 diff --git a/webui.sh b/webui.sh index e0aca3ba..970a0a87 100644 --- a/webui.sh +++ b/webui.sh @@ -36,3 +36,56 @@ echo "HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH echo "HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH" + +# Install git +echo -n "Checking for Git..." +if command -v git > /dev/null 2>&1; then + echo "is installed" +else + read -p "Git is not installed. Would you like to install Git? [Y/N] " choice + if [ "$choice" = "Y" ] || [ "$choice" = "y" ]; then + echo "Installing Git..." + sudo apt update + sudo apt install -y git + else + echo "Please install Git and try again." + exit 1 + fi +fi + +# Check if repository exists +if [[ -d .git ]] ;then +echo Pulling latest changes +##git pull origin main +else +echo Cloning repository... +##git init +##git remote add origin https://github.com/nomic-ai/gpt4all-ui.git +##git fetch +##git reset origin/main +##git checkout -t origin/main +##git pull origin main + +fi + +# Download latest personalities +if ! test -d ./tmp/personalities; then +## git clone https://github.com/ParisNeo/GPT4All_Personalities.git ./tmp/personalities +fi +##cp ./tmp/personalities/* ./personalities/ + +# Install Python 3.10 and pip +echo -n "Checking for python3.10..." +if command -v python3.10 > /dev/null 2>&1; then + echo "is installed" +else + read -p "Python3.10 is not installed. Would you like to install Python3.10? [Y/N] " choice + if [ "$choice" = "Y" ] || [ "$choice" = "y" ]; then + echo "Installing Python3.10..." + sudo apt update + sudo apt install -y python3.10 python3.10-venv + else + echo "Please install Python3.10 and try again." + exit 1 + fi +fi From e28153ac3730b13e56f5c53c50d6774647966fc1 Mon Sep 17 00:00:00 2001 From: andzejsp Date: Wed, 19 Apr 2023 09:58:54 +0300 Subject: [PATCH 03/12] removed unused stuff --- tmpllama.cpp | 1 - 1 file changed, 1 deletion(-) delete mode 160000 tmpllama.cpp diff --git a/tmpllama.cpp b/tmpllama.cpp deleted file mode 160000 index 42747220..00000000 --- a/tmpllama.cpp +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 42747220b4cac548b6e3059b66b3e960b517cfa4 From 34328a7cf3d7ae0c03288dfbe65f5b168ea138d1 Mon Sep 17 00:00:00 2001 From: andzejsp Date: Wed, 19 Apr 2023 11:35:26 +0300 Subject: [PATCH 04/12] Fixed echo --- webui.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webui.bat b/webui.bat index 223de718..2cf78863 100644 --- a/webui.bat +++ b/webui.bat @@ -233,7 +233,7 @@ if %ERRORLEVEL% neq 0 ( exit /b 1 ) -echo Downloading latest model +echo Checking models... if not exist \models ( md \models ) From 41d9d92dd09b4dc6b5eaa0cdd8b4fe232dccc2dc Mon Sep 17 00:00:00 2001 From: andzejsp Date: Wed, 19 Apr 2023 11:35:46 +0300 Subject: [PATCH 05/12] FIrst prototype of working .sh --- webui.sh | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 105 insertions(+), 10 deletions(-) diff --git a/webui.sh b/webui.sh index 970a0a87..94af6777 100644 --- a/webui.sh +++ b/webui.sh @@ -36,7 +36,6 @@ echo "HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH echo "HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH" - # Install git echo -n "Checking for Git..." if command -v git > /dev/null 2>&1; then @@ -56,23 +55,20 @@ fi # Check if repository exists if [[ -d .git ]] ;then echo Pulling latest changes -##git pull origin main +git pull origin main else echo Cloning repository... -##git init -##git remote add origin https://github.com/nomic-ai/gpt4all-ui.git -##git fetch -##git reset origin/main -##git checkout -t origin/main -##git pull origin main +git init +git remote add origin https://github.com/nomic-ai/gpt4all-ui.git +git pull origin main fi # Download latest personalities if ! test -d ./tmp/personalities; then -## git clone https://github.com/ParisNeo/GPT4All_Personalities.git ./tmp/personalities + git clone https://github.com/ParisNeo/GPT4All_Personalities.git ./tmp/personalities fi -##cp ./tmp/personalities/* ./personalities/ +cp ./tmp/personalities/* ./personalities/ # Install Python 3.10 and pip echo -n "Checking for python3.10..." @@ -89,3 +85,102 @@ else exit 1 fi fi + +# Install venv module +echo -n "Checking for venv module..." +if python3.10 -m venv env > /dev/null 2>&1; then + echo "is installed" +else + read -p "venv module is not available. Would you like to install it? [Y/N] " choice + if [ "$choice" = "Y" ] || [ "$choice" = "y" ]; then + echo "Installing venv module..." + sudo apt update + sudo apt install -y python3.10-venv + else + echo "Please install venv module and try again." + exit 1 + fi +fi + +# Create a new virtual environment +echo -n "Creating virtual environment..." +python3.10 -m venv env +if [ $? -ne 0 ]; then + echo "Failed to create virtual environment. Please check your Python installation and try again." + exit 1 +else + echo "is created" +fi + +# Activate the virtual environment +echo -n "Activating virtual environment..." +source env/bin/activate +echo "is active" + +# Install the required packages +echo "Installing requirements..." +python3.10 -m pip install pip --upgrade +python3.10 -m pip install -r requirements.txt + +if [ $? -ne 0 ]; then + echo "Failed to install required packages. Please check your internet connection and try again." + exit 1 +fi + +# Checking model + +MODEL="./models/gpt4all-lora-quantized-ggml.bin" +MODEL_URL="https://huggingface.co/ParisNeo/GPT4All/resolve/main/gpt4all-lora-quantized-ggml.bin" + +if [ -f "$MODEL" ]; then + echo "File $MODEL already exists. Skipping download." + +else + echo "File $MODEL does not exist." + echo "What would you like to do?" + select option in "Download" "Download using browser" "Skip"; do + case $option in + Download) + if [ -x "$(command -v wget)" ]; then + wget $MODEL_URL -P ./models/ + elif [ -x "$(command -v curl)" ]; then + curl -O $MODEL_URL -o $MODEL + else + echo "Error: neither wget nor curl is installed. Please install one of them and try again." + exit 1 + fi + break + ;; + "Download using browser") + if [ -x "$(command -v xdg-open)" ]; then + xdg-open $MODEL_URL + elif [ -x "$(command -v gnome-open)" ]; then + gnome-open $MODEL_URL + elif [ -x "$(command -v kde-open)" ]; then + kde-open $MODEL_URL + elif [ -x "$(command -v open)" ]; then + open $MODEL_URL + else + echo "Error: could not detect a default browser. Please open the link in your web browser manually and press any key to continue." + read -n 1 -s -r -p "Press any key to continue" + fi + break + ;; + Skip) + echo "Skipping downloading $MODEL" + + break + ;; + esac + done +fi + +# Cleanup + +if [ -d "./tmp" ]; then + rm -rf "./tmp" + echo "Cleaning tmp folder" +fi + +# Launch the Python application +python app.py From 57c21b32cb195c3f4a772f452d4ca03c52703226 Mon Sep 17 00:00:00 2001 From: andzejsp Date: Wed, 19 Apr 2023 11:39:08 +0300 Subject: [PATCH 06/12] removed outdated install scripts --- install.3.10.sh | 84 ---------------- install.bat | 259 ------------------------------------------------ install.sh | 134 ------------------------- run.sh | 43 -------- update.sh | 49 --------- webui-a11.sh | 186 ---------------------------------- 6 files changed, 755 deletions(-) delete mode 100644 install.3.10.sh delete mode 100644 install.bat delete mode 100644 install.sh delete mode 100644 run.sh delete mode 100644 update.sh delete mode 100644 webui-a11.sh diff --git a/install.3.10.sh b/install.3.10.sh deleted file mode 100644 index c12049b6..00000000 --- a/install.3.10.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/bash - -# Install Python 3.10 and pip -echo -n "Checking for python3.10..." -if command -v python3.10 > /dev/null 2>&1; then - echo "OK" -else - read -p "Python3.10 is not installed. Would you like to install Python3.10? [Y/N] " choice - if [ "$choice" = "Y" ] || [ "$choice" = "y" ]; then - echo "Installing Python3.10..." - sudo apt update - sudo apt install -y python3.10 python3.10-venv - else - echo "Please install Python3.10 and try again." - exit 1 - fi -fi - -# Install venv module -echo -n "Checking for venv module..." -if python3.10 -m venv env > /dev/null 2>&1; then - echo "OK" -else - read -p "venv module is not available. Would you like to install it? [Y/N] " choice - if [ "$choice" = "Y" ] || [ "$choice" = "y" ]; then - echo "Installing venv module..." - sudo apt update - sudo apt install -y python3.10-venv - else - echo "Please install venv module and try again." - exit 1 - fi -fi - -# Create a new virtual environment -echo -n "Creating virtual environment..." -python3.10 -m venv env -if [ $? -ne 0 ]; then - echo "Failed to create virtual environment. Please check your Python installation and try again." - exit 1 -else - echo "OK" -fi - -# Activate the virtual environment -echo -n "Activating virtual environment..." -source env/bin/activate -echo "OK" - -# Install the required packages -echo "Installing requirements..." -export DS_BUILD_OPS=0 -export DS_BUILD_AIO=0 -python3.10 -m pip install pip --upgrade -python3.10 -m pip install -r requirements.txt - -if [ $? -ne 0 ]; then - echo "Failed to install required packages. Please check your internet connection and try again." - exit 1 -fi - -echo "" -echo "Downloading latest model..." -curl -o "models/gpt4all-lora-quantized-ggml.bin" "https://huggingface.co/ParisNeo/GPT4All/resolve/main/gpt4all-lora-quantized-ggml.bin" -if [ $? -ne 0 ]; then - echo "Failed to download model. Please check your internet connection." - read -p "Do you want to try downloading again? Press Y to download." yn - case $yn in - [Yy]* ) echo "Downloading latest model..." - curl -o "models/gpt4all-lora-quantized-ggml.bin" "https://huggingface.co/ParisNeo/GPT4All/resolve/main/gpt4all-lora-quantized-ggml.bin";; - * ) echo "Skipping download of model file...";; - esac -else - echo "Model successfully downloaded." -fi - -echo "" -echo "Cleaning tmp folder" -rm -rf "./tmp" - - -echo "Virtual environment created and packages installed successfully." -echo "Every thing is setup. Just run run.sh" -exit 0 diff --git a/install.bat b/install.bat deleted file mode 100644 index de563c1d..00000000 --- a/install.bat +++ /dev/null @@ -1,259 +0,0 @@ -@echo off - -echo HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHH .HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHH. ,HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHH.## HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHHH#.HHHHH/*,*,*,*,*,*,*,*,***,*,**#HHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHHHHH.*,,***,***,***,***,***,***,*******HHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHHH*,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,*,,,,,HHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHH.,,,***,***,***,***,***,***,***,***,***,***/HHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHH*,,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*HHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHH#,***,***,***,***,***,***,***,***,***,***,***,**HHHHHHHHHHHHHHHHH -echo HHHHHHHHHH..HHH,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,*#HHHHHHHHHHHHHHHH -echo HHHHHHH,,,**,/H*,***,***,***,,,*,***,***,***,**,,,**,***,***,***H,,*,***HHHHHHHH -echo HHHHHH.*,,,*,,,,,*,*,*,***#HHHHH.,,*,*,*,*,**/HHHHH.,*,*,*,*,*,*,*,*****HHHHHHHH -echo HHHHHH.*,***,*,*,***,***,.HHHHHHH/**,***,****HHHHHHH.***,***,***,*******HHHHHHHH -echo HHHHHH.,,,,,,,,,,,,,,,,,,,.HHHHH.,,,,,,,,,,,,.HHHHHH,,,,,,,,,,,,,,,,,***HHHHHHHH -echo HHHHHH.,,,,,,/H,,,**,***,***,,,*,***,***,***,**,,,,*,***,***,***H***,***HHHHHHHH -echo HHHHHHH.,,,,*.H,,,,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,***H*,,,,/HHHHHHHHH -echo HHHHHHHHHHHHHHH*,***,***,**,,***,***,***,***,***,***,***,***,**.HHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHH,,,,,,,,*,,#H#,,,,,*,,,*,,,,,,,,*#H*,,,,,,,,,**HHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHH,,*,***,***,**/.HHHHHHHHHHHHH#*,,,*,***,***,*HHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHH,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*HHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHH**,***,***,***,***,***,***,***,***,***,***,*.HHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHH*,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,*HHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHH**,***,***,*******/..HHHHHHHHH.#/*,*,,,***,***HHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHH*,*,*,******#HHHHHHHHHHHHHHHHHHHHHHHHHHHH./**,,,.HHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHH.,,*,***.HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH.*#HHHHHHHHHHHH -echo HHHHHHHHHHHHHHH/,,,*.HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHH,,#HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHH.HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH - -if not exist "./tmp" mkdir "./tmp" - -REM Check if Git is installed -echo "Checking for git..." -where git >nul 2>&1 -if %ERRORLEVEL% EQU 0 ( - goto GIT_CHECKED -) else ( - goto GIT_INSTALL -) -:GIT_FINISH - -REM Check if Git is installed -:GIT_CHECKED -echo "Git is installed." -goto GIT_SKIP - -:GIT_INSTALL -echo. -choice /C YN /M "Do you want to download and install Git?" -if errorlevel 2 goto GIT_CANCEL -if errorlevel 1 goto GIT_INSTALL_2 - -:GIT_INSTALL_2 -echo "Git is not installed. Installing Git..." -powershell.exe -Command "Start-Process https://git-scm.com/download/win -Wait" -goto GIT_SKIP - -:GIT_CANCEL -echo. -echo Git download cancelled. -echo Please install Git and try again. -pause -exit /b 1 - -:GIT_SKIP - -REM Check if Python is installed -set /p="Checking for python..." nul 2>&1 -if %ERRORLEVEL% EQU 0 ( - goto PYTHON_CHECKED -) else ( - goto PYTHON_INSTALL -) -:PYTHON_CHECKED -echo "Python is installed." -goto PYTHON_SKIP - -:PYTHON_INSTALL -echo. -choice /C YN /M "Do you want to download and install python?" -if errorlevel 2 goto PYTHON_CANCEL -if errorlevel 1 goto PYTHON_INSTALL_2 - -:PYTHON_INSTALL_2 -REM Download Python installer -echo Downloading Python installer... -powershell -Command "Invoke-WebRequest -Uri 'https://www.python.org/ftp/python/3.10.0/python-3.10.0-amd64.exe' -OutFile 'tmp/python.exe'" -REM Install Python -echo Installing Python... -tmp/python.exe /quiet /norestart - -:PYTHON_CANCEL -echo Please install python and try again. -pause -exit /b 1 - -:PYTHON_SKIP - - -REM Check if pip is installed -set /p="Checking for pip..." nul 2>&1 -if %ERRORLEVEL% EQU 0 ( - goto PIP_CHECKED -) else ( - goto PIP_INSTALL -) -:PIP_CHECKED -echo "Pip is installed." -goto PIP_SKIP - -:PIP_INSTALL -echo. -choice /C YN /M "Do you want to download and install pip?" -if errorlevel 2 goto PIP_CANCEL -if errorlevel 1 goto PIP_INSTALL_2 - -:PIP_INSTALL_2 -REM Download get-pip.py -echo Downloading get-pip.py... -powershell -Command "Invoke-WebRequest -Uri 'https://bootstrap.pypa.io/get-pip.py' -OutFile 'tmp/get-pip.py'" -REM Install pip -echo Installing pip... -python tmp/get-pip.py - -:PIP_CANCEL -echo Please install pip and try again. -pause -exit /b 1 - -:PIP_SKIP - -REM Upgrading pip setuptools and wheel -echo Updating pip setuptools and wheel -python -m pip install --upgrade pip setuptools wheel - - -REM Check if pip is installed -set /p="Checking for virtual environment..." nul 2>&1 -if %ERRORLEVEL% EQU 0 ( - goto VENV_CHECKED -) else ( - goto VENV_INSTALL -) -:VENV_CHECKED -echo "Virtual environment is installed." -goto VENV_SKIP - -:VENV_INSTALL -echo. -choice /C YN /M "Do you want to download and install venv?" -if errorlevel 2 goto VENV_CANCEL -if errorlevel 1 goto VENV_INSTALL_2 - -:VENV_INSTALL_2 -REM Installinv venv -echo installing venv... -pip install virtualenv - -:VENV_CANCEL -echo Please install venv and try again. -pause -exit /b 1 - -:VENV_SKIP - - -REM Create a new virtual environment -set /p="Creating virtual environment ..." nul 2>&1 -if %ERRORLEVEL% EQU 0 ( - goto VENV_CREATED -) else ( - echo Failed to create virtual environment. Please check your Python installation and try again. - pause - exit /b 1 -) - -:VENV_CREATED - -REM Activate the virtual environment -set /p="Activating virtual environment ..." /dev/null 2>&1; then - echo "OK" -else - read -p "Python3.11 is not installed. Would you like to install Python3.11? [Y/N] " choice - if [ "$choice" = "Y" ] || [ "$choice" = "y" ]; then - echo "Installing Python3.11..." - sudo apt update - sudo apt install -y python3.11 python3.11-venv - else - echo "Please install Python3.11 and try again." - exit 1 - fi -fi - -# check if cmake is installed, if not install it -if [ "$(command -v cmake)" = "" ]; then - echo "cmake not found, installing cmake ..." - sudo apt-get install -y cmake # for Linux - brew install cmake # for macOS -fi - -# check if nproc is installed, if not install it -if [ "$(command -v nproc)" = "" ]; then - echo "nproc not found, installing nproc ..." - sudo apt-get install -y coreutils # for Linux - brew install coreutils # for macOS -fi - -# Install venv module -echo -n "Checking for venv module..." -if python3.11 -m venv env > /dev/null 2>&1; then - echo "OK" -else - read -p "venv module is not available. Would you like to install it? [Y/N] " choice - if [ "$choice" = "Y" ] || [ "$choice" = "y" ]; then - echo "Installing venv module..." - sudo apt update - sudo apt install -y python3.11-venv - else - echo "Please install venv module and try again." - exit 1 - fi -fi - -# Create a new virtual environment -echo -n "Creating virtual environment..." -python3.11 -m venv env -if [ $? -ne 0 ]; then - echo "Failed to create virtual environment. Please check your Python installation and try again." - exit 1 -else - echo "OK" -fi - -# Activate the virtual environment -echo -n "Activating virtual environment..." -source env/bin/activate -echo "OK" - -# Install the required packages -echo "Installing requirements..." -python3.11 -m pip install pip --upgrade -python3.11 -m pip install -r requirements.txt - -if [ $? -ne 0 ]; then - echo "Failed to install required packages. Please check your internet connection and try again." - exit 1 -fi - - -echo "" -echo "Downloading latest model..." -curl -o "models/gpt4all-lora-quantized-ggml.bin" "https://huggingface.co/ParisNeo/GPT4All/resolve/main/gpt4all-lora-quantized-ggml.bin" -if [ $? -ne 0 ]; then - echo "Failed to download model. Please check your internet connection." - read -p "Do you want to try downloading again? Press Y to download." yn - case $yn in - [Yy]* ) echo "Downloading latest model..." - curl -o "models/gpt4all-lora-quantized-ggml.bin" "https://huggingface.co/ParisNeo/GPT4All/resolve/main/gpt4all-lora-quantized-ggml.bin";; - * ) echo "Skipping download of model file...";; - esac -else - echo "Model successfully downloaded." -fi - -echo "" -echo "Cleaning tmp folder" -rm -rf "./tmp" - - -echo "Virtual environment created and packages installed successfully." -echo "Every thing is setup. Just run run.sh" -exit 0 diff --git a/run.sh b/run.sh deleted file mode 100644 index b3b1a4e0..00000000 --- a/run.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash - -echo HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHH .HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHH. ,HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHH.## HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHHH#.HHHHH/*,*,*,*,*,*,*,*,***,*,**#HHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHHHHH.*,,***,***,***,***,***,***,*******HHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHHH*,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,*,,,,,HHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHH.,,,***,***,***,***,***,***,***,***,***,***/HHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHH*,,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*HHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHH#,***,***,***,***,***,***,***,***,***,***,***,**HHHHHHHHHHHHHHHHH -echo HHHHHHHHHH..HHH,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,*#HHHHHHHHHHHHHHHH -echo HHHHHHH,,,**,/H*,***,***,***,,,*,***,***,***,**,,,**,***,***,***H,,*,***HHHHHHHH -echo HHHHHH.*,,,*,,,,,*,*,*,***#HHHHH.,,*,*,*,*,**/HHHHH.,*,*,*,*,*,*,*,*****HHHHHHHH -echo HHHHHH.*,***,*,*,***,***,.HHHHHHH/**,***,****HHHHHHH.***,***,***,*******HHHHHHHH -echo HHHHHH.,,,,,,,,,,,,,,,,,,,.HHHHH.,,,,,,,,,,,,.HHHHHH,,,,,,,,,,,,,,,,,***HHHHHHHH -echo HHHHHH.,,,,,,/H,,,**,***,***,,,*,***,***,***,**,,,,*,***,***,***H***,***HHHHHHHH -echo HHHHHHH.,,,,*.H,,,,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,***H*,,,,/HHHHHHHHH -echo HHHHHHHHHHHHHHH*,***,***,**,,***,***,***,***,***,***,***,***,**.HHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHH,,,,,,,,*,,#H#,,,,,*,,,*,,,,,,,,*#H*,,,,,,,,,**HHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHH,,*,***,***,**/.HHHHHHHHHHHHH#*,,,*,***,***,*HHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHH,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*HHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHH**,***,***,***,***,***,***,***,***,***,***,*.HHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHH*,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,*HHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHH**,***,***,*******/..HHHHHHHHH.#/*,*,,,***,***HHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHH*,*,*,******#HHHHHHHHHHHHHHHHHHHHHHHHHHHH./**,,,.HHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHH.,,*,***.HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH.*#HHHHHHHHHHHH -echo HHHHHHHHHHHHHHH/,,,*.HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHH,,#HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHH.HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH - - -# Activate the virtual environment -source env/bin/activate - -# Launch the Python application -python app.py diff --git a/update.sh b/update.sh deleted file mode 100644 index 87c9b95f..00000000 --- a/update.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh -echo HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHH .HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHH. ,HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHH.## HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHHH#.HHHHH/*,*,*,*,*,*,*,*,***,*,**#HHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHHHHH.*,,***,***,***,***,***,***,*******HHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHHH*,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,*,,,,,HHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHH.,,,***,***,***,***,***,***,***,***,***,***/HHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHH*,,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*HHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHH#,***,***,***,***,***,***,***,***,***,***,***,**HHHHHHHHHHHHHHHHH -echo HHHHHHHHHH..HHH,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,*#HHHHHHHHHHHHHHHH -echo HHHHHHH,,,**,/H*,***,***,***,,,*,***,***,***,**,,,**,***,***,***H,,*,***HHHHHHHH -echo HHHHHH.*,,,*,,,,,*,*,*,***#HHHHH.,,*,*,*,*,**/HHHHH.,*,*,*,*,*,*,*,*****HHHHHHHH -echo HHHHHH.*,***,*,*,***,***,.HHHHHHH/**,***,****HHHHHHH.***,***,***,*******HHHHHHHH -echo HHHHHH.,,,,,,,,,,,,,,,,,,,.HHHHH.,,,,,,,,,,,,.HHHHHH,,,,,,,,,,,,,,,,,***HHHHHHHH -echo HHHHHH.,,,,,,/H,,,**,***,***,,,*,***,***,***,**,,,,*,***,***,***H***,***HHHHHHHH -echo HHHHHHH.,,,,*.H,,,,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,***H*,,,,/HHHHHHHHH -echo HHHHHHHHHHHHHHH*,***,***,**,,***,***,***,***,***,***,***,***,**.HHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHH,,,,,,,,*,,#H#,,,,,*,,,*,,,,,,,,*#H*,,,,,,,,,**HHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHH,,*,***,***,**/.HHHHHHHHHHHHH#*,,,*,***,***,*HHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHH,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*HHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHH**,***,***,***,***,***,***,***,***,***,***,*.HHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHH*,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,*HHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHH**,***,***,*******/..HHHHHHHHH.#/*,*,,,***,***HHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHH*,*,*,******#HHHHHHHHHHHHHHHHHHHHHHHHHHHH./**,,,.HHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHH.,,*,***.HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH.*#HHHHHHHHHHHH -echo HHHHHHHHHHHHHHH/,,,*.HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHH,,#HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHH.HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH - -echo "Activate the virtual environment" -source env/bin/activate - -echo "Pull latest version of the code" -git pull - -if ! test -d ./tmp/personalities; then - git clone https://github.com/ParisNeo/GPT4All_Personalities.git ./tmp/personalities -fi -cp ./tmp/personalities/* ./personalities/ - -echo "Cleaning tmp folder" -rm -rf ./tmp diff --git a/webui-a11.sh b/webui-a11.sh deleted file mode 100644 index 8cdad22d..00000000 --- a/webui-a11.sh +++ /dev/null @@ -1,186 +0,0 @@ -#!/usr/bin/env bash -################################################# -# Please do not make any changes to this file, # -# change the variables in webui-user.sh instead # -################################################# - -# If run from macOS, load defaults from webui-macos-env.sh -if [[ "$OSTYPE" == "darwin"* ]]; then - if [[ -f webui-macos-env.sh ]] - then - source ./webui-macos-env.sh - fi -fi - -# Read variables from webui-user.sh -# shellcheck source=/dev/null -if [[ -f webui-user.sh ]] -then - source ./webui-user.sh -fi - -# Set defaults -# Install directory without trailing slash -if [[ -z "${install_dir}" ]] -then - install_dir="/home/$(whoami)" -fi - -# Name of the subdirectory (defaults to stable-diffusion-webui) -if [[ -z "${clone_dir}" ]] -then - clone_dir="stable-diffusion-webui" -fi - -# python3 executable -if [[ -z "${python_cmd}" ]] -then - python_cmd="python3" -fi - -# git executable -if [[ -z "${GIT}" ]] -then - export GIT="git" -fi - -# python3 venv without trailing slash (defaults to ${install_dir}/${clone_dir}/venv) -if [[ -z "${venv_dir}" ]] -then - venv_dir="venv" -fi - -if [[ -z "${LAUNCH_SCRIPT}" ]] -then - LAUNCH_SCRIPT="launch.py" -fi - -# this script cannot be run as root by default -can_run_as_root=0 - -# read any command line flags to the webui.sh script -while getopts "f" flag > /dev/null 2>&1 -do - case ${flag} in - f) can_run_as_root=1;; - *) break;; - esac -done - -# Disable sentry logging -export ERROR_REPORTING=FALSE - -# Do not reinstall existing pip packages on Debian/Ubuntu -export PIP_IGNORE_INSTALLED=0 - -# Pretty print -delimiter="################################################################" - -printf "\n%s\n" "${delimiter}" -printf "\e[1m\e[32mInstall script for stable-diffusion + Web UI\n" -printf "\e[1m\e[34mTested on Debian 11 (Bullseye)\e[0m" -printf "\n%s\n" "${delimiter}" - -# Do not run as root -if [[ $(id -u) -eq 0 && can_run_as_root -eq 0 ]] -then - printf "\n%s\n" "${delimiter}" - printf "\e[1m\e[31mERROR: This script must not be launched as root, aborting...\e[0m" - printf "\n%s\n" "${delimiter}" - exit 1 -else - printf "\n%s\n" "${delimiter}" - printf "Running on \e[1m\e[32m%s\e[0m user" "$(whoami)" - printf "\n%s\n" "${delimiter}" -fi - -if [[ -d .git ]] -then - printf "\n%s\n" "${delimiter}" - printf "Repo already cloned, using it as install directory" - printf "\n%s\n" "${delimiter}" - install_dir="${PWD}/../" - clone_dir="${PWD##*/}" -fi - -# Check prerequisites -gpu_info=$(lspci 2>/dev/null | grep VGA) -case "$gpu_info" in - *"Navi 1"*|*"Navi 2"*) export HSA_OVERRIDE_GFX_VERSION=10.3.0 - ;; - *"Renoir"*) export HSA_OVERRIDE_GFX_VERSION=9.0.0 - printf "\n%s\n" "${delimiter}" - printf "Experimental support for Renoir: make sure to have at least 4GB of VRAM and 10GB of RAM or enable cpu mode: --use-cpu all --no-half" - printf "\n%s\n" "${delimiter}" - ;; - *) - ;; -esac -if echo "$gpu_info" | grep -q "AMD" && [[ -z "${TORCH_COMMAND}" ]] -then - export TORCH_COMMAND="pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/rocm5.2" -fi - -for preq in "${GIT}" "${python_cmd}" -do - if ! hash "${preq}" &>/dev/null - then - printf "\n%s\n" "${delimiter}" - printf "\e[1m\e[31mERROR: %s is not installed, aborting...\e[0m" "${preq}" - printf "\n%s\n" "${delimiter}" - exit 1 - fi -done - -if ! "${python_cmd}" -c "import venv" &>/dev/null -then - printf "\n%s\n" "${delimiter}" - printf "\e[1m\e[31mERROR: python3-venv is not installed, aborting...\e[0m" - printf "\n%s\n" "${delimiter}" - exit 1 -fi - -cd "${install_dir}"/ || { printf "\e[1m\e[31mERROR: Can't cd to %s/, aborting...\e[0m" "${install_dir}"; exit 1; } -if [[ -d "${clone_dir}" ]] -then - cd "${clone_dir}"/ || { printf "\e[1m\e[31mERROR: Can't cd to %s/%s/, aborting...\e[0m" "${install_dir}" "${clone_dir}"; exit 1; } -else - printf "\n%s\n" "${delimiter}" - printf "Clone stable-diffusion-webui" - printf "\n%s\n" "${delimiter}" - "${GIT}" clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git "${clone_dir}" - cd "${clone_dir}"/ || { printf "\e[1m\e[31mERROR: Can't cd to %s/%s/, aborting...\e[0m" "${install_dir}" "${clone_dir}"; exit 1; } -fi - -printf "\n%s\n" "${delimiter}" -printf "Create and activate python venv" -printf "\n%s\n" "${delimiter}" -cd "${install_dir}"/"${clone_dir}"/ || { printf "\e[1m\e[31mERROR: Can't cd to %s/%s/, aborting...\e[0m" "${install_dir}" "${clone_dir}"; exit 1; } -if [[ ! -d "${venv_dir}" ]] -then - "${python_cmd}" -m venv "${venv_dir}" - first_launch=1 -fi -# shellcheck source=/dev/null -if [[ -f "${venv_dir}"/bin/activate ]] -then - source "${venv_dir}"/bin/activate -else - printf "\n%s\n" "${delimiter}" - printf "\e[1m\e[31mERROR: Cannot activate python venv, aborting...\e[0m" - printf "\n%s\n" "${delimiter}" - exit 1 -fi - -if [[ ! -z "${ACCELERATE}" ]] && [ ${ACCELERATE}="True" ] && [ -x "$(command -v accelerate)" ] -then - printf "\n%s\n" "${delimiter}" - printf "Accelerating launch.py..." - printf "\n%s\n" "${delimiter}" - exec accelerate launch --num_cpu_threads_per_process=6 "${LAUNCH_SCRIPT}" "$@" -else - printf "\n%s\n" "${delimiter}" - printf "Launching launch.py..." - printf "\n%s\n" "${delimiter}" - exec "${python_cmd}" "${LAUNCH_SCRIPT}" "$@" -fi From ca1d8ee372904a59e56801775f98a8e65ed2ee2d Mon Sep 17 00:00:00 2001 From: andzejsp Date: Wed, 19 Apr 2023 11:56:39 +0300 Subject: [PATCH 07/12] outdated and not needed --- CHANGELOG.md | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 7249c715..00000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,9 +0,0 @@ -# GPT4ALL-Webui Change Log - -# V 0.0.1 -1 - Interaction with the bot in threaded discussion -2 - List of past discussions -3 - New Discussion -4 - Edit discussion name -5 - Remove discussion -6 - Export database as json From 1c8b3360f2472c284dc115c05aa356b1fcf6bb90 Mon Sep 17 00:00:00 2001 From: andzejsp Date: Wed, 19 Apr 2023 12:13:22 +0300 Subject: [PATCH 08/12] updated readme --- README.md | 94 ++++++++++++++++++++++++++++++++----------------------- 1 file changed, 55 insertions(+), 39 deletions(-) diff --git a/README.md b/README.md index 7b463925..707e1617 100644 --- a/README.md +++ b/README.md @@ -47,16 +47,15 @@ Make sure that your CPU supports `AVX2` instruction set. Without it, this applic ### Automatic install 1. Open directory on your computer where you want to download/install this application (This will create new directory: `/gpt4all-ui/`. Make sure a folder with this name does not exist in this direcotry.) -2. Press and holde `Shift` on your keyboard and `right click` with your mouse inside a folder. Select from a menu `Open Terminal` or `Open to powershell windows here` (This command can hide under `Show more options` in Windows 11). +2. Press and hold `Shift` on your keyboard and `Right click` with your mouse inside a folder. Select from a menu `Open Terminal` or `Open to powershell windows here` (This command can hide under `Show more options` in Windows 11). 3. Copy and paste this command and press enter: - +``` +mkdir gpt4all-ui & curl https://raw.githubusercontent.com/nomic-ai/gpt4all-ui/main/webui.bat -o ./gpt4all-ui/webui.bat ; pushd ./gpt4all/ ; Invoke-Expression -Command "./webui.bat" +``` > **Note** > > This command creates new directory `/gpt4all-ui/`, downloads a file [webui.bat](https://raw.githubusercontent.com/nomic-ai/gpt4all-ui/main/webui.bat), changes current work directory to `/gpt4all-ui/` and executes webui.bat that downloads and installs everything that is needed. -``` -mkdir gpt4all-ui & curl https://raw.githubusercontent.com/nomic-ai/gpt4all-ui/main/webui.bat -o ./gpt4all-ui/webui.bat ; pushd ./gpt4all/ ; Invoke-Expression -Command "./webui.bat" -``` 4. Follow instructions on screen until it launches webui. 5. To relaunch application double click on `webui.bat` file from Windows explorer as normal user. @@ -82,19 +81,62 @@ git clone https://github.com/nomic-ai/gpt4all-ui.git ## Linux +### Automatic install + +1. Make sure you have installed `curl`. It is needed for the one-liner to work. + +`Debian-based:` +``` +sudo apt install curl +``` +`Red Hat-based:` +``` +sudo dnf install curl +``` +`Arch-based:` +``` +sudo pacman -S curl +``` +2. Open terminal/console copy and paste this command and press enter: +``` +mkdir -p ~/gpt4all-ui && curl -L https://raw.githubusercontent.com/nomic-ai/gpt4all-ui/main/mega.sh -o ~/gpt4all-ui/webui.sh && chmod +x ~/gpt4all-ui/webui.sh && ~/gpt4all-ui/webui.sh +``` +> **Note** +> +> This command creates new directory `/gpt4all-ui/` in your /home/ direcory, downloads a file [webui.sh](https://raw.githubusercontent.com/nomic-ai/gpt4all-ui/main/webui.sh), makes file executable and executes webui.sh that downloads and installs everything that is needed. + +3. Follow instructions on screen until it launches webui. +4. To relaunch application: +``` +bash webui.sh +``` + +### Manual Simple install: + +1. Download this repository .zip: + +![image](https://user-images.githubusercontent.com/80409979/232210909-0ce3dc80-ed34-4b32-b828-e124e3df3ff1.png) + +2. Extract contents into a folder. +3. Install/run application from terminal/console: +``` +bash webui.sh +``` +### Manual Advanced mode: + 1. Open terminal/console and install dependencies: `Debian-based:` ``` -sudo apt install git python3 python3-venv +sudo apt install curl git python3 python3-venv ``` `Red Hat-based:` ``` -sudo dnf install git python3 +sudo dnf install curl git python3 ``` `Arch-based:` ``` -sudo pacman -S git python3 +sudo pacman -S curl git python3 ``` 2. Clone repository: @@ -106,16 +148,10 @@ git clone https://github.com/nomic-ai/gpt4all-ui.git cd gpt4all-ui ``` -3. Run installation: +3. Install/run application: ```bash -bash ./install.sh -``` - -4. Run application: - -```bash -bash ./run.sh +bash ./webui.sh ``` ## MacOS @@ -141,16 +177,10 @@ git clone https://github.com/nomic-ai/gpt4all-ui.git cd gpt4all-ui ``` -4. Run installation: +4. Install/run application: ```bash -bash ./install.sh -``` - -5. Run application: - -```bash -bash ./run.sh +bash ./webui.sh ``` On Linux/MacOS, if you have issues, refer to the details presented [here](docs/Linux_Osx_Install.md) @@ -170,10 +200,7 @@ Start docker compose -f docker-compose.yml up ``` -Stop -``` -Ctrl + C -``` +Stop ` Ctrl ` + ` C ` Start detached (runs in background) ```bash @@ -196,7 +223,6 @@ You can also refuse to download the model during the install procedure and downl - [GPT4ALL 7B](https://huggingface.co/ParisNeo/GPT4All/resolve/main/gpt4all-lora-quantized-ggml.bin) or visit [repository](https://huggingface.co/ParisNeo/GPT4All) - [GPT4ALL 7B unfiltered](https://huggingface.co/ParisNeo/GPT4All/blob/main/gpt4all-lora-unfiltered-quantized.new.bin) or visit [repository](https://huggingface.co/ParisNeo/GPT4All) - - [Vicuna 7B rev 1](https://huggingface.co/eachadea/legacy-ggml-vicuna-7b-4bit/resolve/main/ggml-vicuna-7b-4bit-rev1.bin) or visit [repository](https://huggingface.co/eachadea/legacy-ggml-vicuna-7b-4bit) - [Vicuna 13B rev 1](https://huggingface.co/eachadea/ggml-vicuna-13b-4bit/resolve/main/ggml-vicuna-13b-4bit-rev1.bin) or visit [repository](https://huggingface.co/eachadea/ggml-vicuna-13b-4bit) @@ -264,16 +290,6 @@ Once the server is running, open your web browser and navigate to http://localho Make sure to adjust the default values and descriptions of the options to match your specific application. -# Update application To latest version - -On Windows, run: -```bash -update.bat -``` -On Linux or OS X, run: -```bash -bash update.sh -``` # Contribute This is an open-source project by the community and for the community. Our chatbot is a UI wrapper for Nomic AI's model, which enables natural language processing and machine learning capabilities. From ed247e95477b72a0886d9561a2b4e1237ecd4c29 Mon Sep 17 00:00:00 2001 From: andzejsp Date: Wed, 19 Apr 2023 12:42:37 +0300 Subject: [PATCH 09/12] removed unused stuff --- install-macos.sh | 149 ----------------------------------------------- 1 file changed, 149 deletions(-) delete mode 100644 install-macos.sh diff --git a/install-macos.sh b/install-macos.sh deleted file mode 100644 index ee68cf4b..00000000 --- a/install-macos.sh +++ /dev/null @@ -1,149 +0,0 @@ -#!/usr/bin/bash - - -echo HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHH .HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHH. ,HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHH.## HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHHH#.HHHHH/*,*,*,*,*,*,*,*,***,*,**#HHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHHHHH.*,,***,***,***,***,***,***,*******HHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHHH*,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,*,,,,,HHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHH.,,,***,***,***,***,***,***,***,***,***,***/HHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHH*,,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*HHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHH#,***,***,***,***,***,***,***,***,***,***,***,**HHHHHHHHHHHHHHHHH -echo HHHHHHHHHH..HHH,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,*#HHHHHHHHHHHHHHHH -echo HHHHHHH,,,**,/H*,***,***,***,,,*,***,***,***,**,,,**,***,***,***H,,*,***HHHHHHHH -echo HHHHHH.*,,,*,,,,,*,*,*,***#HHHHH.,,*,*,*,*,**/HHHHH.,*,*,*,*,*,*,*,*****HHHHHHHH -echo HHHHHH.*,***,*,*,***,***,.HHHHHHH/**,***,****HHHHHHH.***,***,***,*******HHHHHHHH -echo HHHHHH.,,,,,,,,,,,,,,,,,,,.HHHHH.,,,,,,,,,,,,.HHHHHH,,,,,,,,,,,,,,,,,***HHHHHHHH -echo HHHHHH.,,,,,,/H,,,**,***,***,,,*,***,***,***,**,,,,*,***,***,***H***,***HHHHHHHH -echo HHHHHHH.,,,,*.H,,,,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,***H*,,,,/HHHHHHHHH -echo HHHHHHHHHHHHHHH*,***,***,**,,***,***,***,***,***,***,***,***,**.HHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHH,,,,,,,,*,,#H#,,,,,*,,,*,,,,,,,,*#H*,,,,,,,,,**HHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHH,,*,***,***,**/.HHHHHHHHHHHHH#*,,,*,***,***,*HHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHH,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*HHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHH**,***,***,***,***,***,***,***,***,***,***,*.HHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHH*,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,*HHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHH**,***,***,*******/..HHHHHHHHH.#/*,*,,,***,***HHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHH*,*,*,******#HHHHHHHHHHHHHHHHHHHHHHHHHHHH./**,,,.HHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHH.,,*,***.HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH.*#HHHHHHHHHHHH -echo HHHHHHHHHHHHHHH/,,,*.HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHH,,#HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHH.HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH -echo HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH - - -# Install Python 3.11 and pip -echo -n "Checking for python3.11..." -if command -v python3.11 > /dev/null 2>&1; then - echo "OK" -else - read -p "Python3.11 is not installed. Would you like to install Python3.11? [Y/N] " choice - if [ "$choice" = "Y" ] || [ "$choice" = "y" ]; then - echo "Installing Python3.11..." - brew install python@3.11 - else - echo "Please install Python3.11 and try again." - exit 1 - fi -fi - -#check if cmake is installed, if not install it -if [ "$(command -v cmake)" = "" ]; then - echo "cmake not found, installing cmake ..." - brew install cmake -fi - -# check if nproc is installed, if not install it -if [ "$(command -v nproc)" = "" ]; then - echo "nproc not found, installing nproc ..." - brew install coreutils -fi - -# Install venv module -echo -n "Checking for venv module..." -if python3.11 -m venv env > /dev/null 2>&1; then - echo "OK" -else - read -p "venv module is not available. Would you like to install it? [Y/N] " choice - if [ "$choice" = "Y" ] || [ "$choice" = "y" ]; then - echo "Installing venv module..." - python3.11 -m ensurepip --upgrade - python3.11 -m pip install virtualenv - else - echo "Please install venv module and try again." - exit 1 - fi -fi - -# Create a new virtual environment -echo -n "Creating virtual environment..." -python3.11 -m venv env -if [ $? -ne 0 ]; then - echo "Failed to create virtual environment. Please check your Python installation and try again." - exit 1 -else - echo "OK" -fi - -# Activate the virtual environment -echo -n "Activating virtual environment..." -source env/bin/activate -echo "OK" - -# Install the required packages -echo "Installing requirements..." -export DS_BUILD_OPS=0 -export DS_BUILD_AIO=0 -python3.11 -m pip install pip --upgrade -python3.11 -m pip install -r requirements.txt - -if [ $? -ne 0 ]; then - echo "Failed to install required packages. Please check your internet connection and try again." - exit 1 -fi - -echo Downloading latest model -curl -o models/gpt4all-lora-quantized-ggml.bin https://the-eye.eu/public/AI/models/nomic-ai/gpt4all/gpt4all-lora-quantized-ggml.bin -if [ $? -ne 0 ]; then - echo "Failed to download model. Please check your internet connection and try again." - exit 1 -fi - -echo "Downloading latest model" -if [ ! -d "models" ]; then - mkdir models -fi - -if [ ! -f "models/gpt4all-lora-quantized-ggml.bin" ]; then - echo "" - read -p "The default model file (gpt4all-lora-quantized-ggml.bin) does not exist. Do you want to download it? Press Y to download it with a browser (faster)." yn - case $yn in - [Yy]* ) open "https://huggingface.co/ParisNeo/GPT4All/resolve/main/gpt4all-lora-quantized-ggml.bin" - echo "Link has been opened with the default web browser, make sure to save it into the models folder before continuing. Press any key to continue..." - read -n 1 -s;; - * ) echo "Skipping download of model file...";; - esac -else - echo "" - read -p "The default model file (gpt4all-lora-quantized-ggml.bin) already exists. Do you want to replace it? Press Y to download it with a browser (faster)." yn - case $yn in - [Yy]* ) open "https://huggingface.co/ParisNeo/GPT4All/resolve/main/gpt4all-lora-quantized-ggml.bin" - echo "Link has been opened with the default web browser, make sure to save it into the models folder before continuing. Press any key to continue..." - read -n 1 -s;; - * ) echo "Skipping download of model file...";; - esac -fi - -echo "" -echo "Cleaning tmp folder" -rm -rf "./tmp" - - -echo "Virtual environment created and packages installed successfully." -echo "Every thing is setup. Just run run.sh" -exit 0 From c19dfae0530ed472fa84d2ab7b13c79192278b21 Mon Sep 17 00:00:00 2001 From: andzejsp Date: Wed, 19 Apr 2023 12:44:36 +0300 Subject: [PATCH 10/12] typo fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 843699da..08447b8f 100644 --- a/README.md +++ b/README.md @@ -99,7 +99,7 @@ sudo pacman -S curl ``` 2. Open terminal/console copy and paste this command and press enter: ``` -mkdir -p ~/gpt4all-ui && curl -L https://raw.githubusercontent.com/nomic-ai/gpt4all-ui/main/mega.sh -o ~/gpt4all-ui/webui.sh && chmod +x ~/gpt4all-ui/webui.sh && ~/gpt4all-ui/webui.sh +mkdir -p ~/gpt4all-ui && curl -L https://raw.githubusercontent.com/nomic-ai/gpt4all-ui/main/webui.sh -o ~/gpt4all-ui/webui.sh && chmod +x ~/gpt4all-ui/webui.sh && ~/gpt4all-ui/webui.sh ``` > **Note** > From 6dc81d4715db582936fa71b21616c5beded5cae5 Mon Sep 17 00:00:00 2001 From: andzejsp Date: Wed, 19 Apr 2023 13:04:02 +0300 Subject: [PATCH 11/12] fixed one liner --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 08447b8f..f0c0b003 100644 --- a/README.md +++ b/README.md @@ -99,7 +99,7 @@ sudo pacman -S curl ``` 2. Open terminal/console copy and paste this command and press enter: ``` -mkdir -p ~/gpt4all-ui && curl -L https://raw.githubusercontent.com/nomic-ai/gpt4all-ui/main/webui.sh -o ~/gpt4all-ui/webui.sh && chmod +x ~/gpt4all-ui/webui.sh && ~/gpt4all-ui/webui.sh +mkdir -p ~/gpt4all-ui2 && curl -L https://raw.githubusercontent.com/nomic-ai/gpt4all-ui/main/webui.sh -o ~/gpt4all-ui2/webui.sh && chmod +x ~/gpt4all-ui2/webui.sh && cd ~/gpt4all-ui2 && ./webui.sh ``` > **Note** > From 33610e044e98ecdaee52fd562abd9794ff34c055 Mon Sep 17 00:00:00 2001 From: andzejsp Date: Wed, 19 Apr 2023 13:05:29 +0300 Subject: [PATCH 12/12] fixed the path --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f0c0b003..76bbd554 100644 --- a/README.md +++ b/README.md @@ -99,7 +99,7 @@ sudo pacman -S curl ``` 2. Open terminal/console copy and paste this command and press enter: ``` -mkdir -p ~/gpt4all-ui2 && curl -L https://raw.githubusercontent.com/nomic-ai/gpt4all-ui/main/webui.sh -o ~/gpt4all-ui2/webui.sh && chmod +x ~/gpt4all-ui2/webui.sh && cd ~/gpt4all-ui2 && ./webui.sh +mkdir -p ~/gpt4all-ui && curl -L https://raw.githubusercontent.com/nomic-ai/gpt4all-ui/main/webui.sh -o ~/gpt4all-ui/webui.sh && chmod +x ~/gpt4all-ui/webui.sh && cd ~/gpt4all-ui && ./webui.sh ``` > **Note** >