2023-05-23 01:43:09 +00:00
|
|
|
#!/usr/bin/env bash
|
2023-06-12 14:25:24 +00:00
|
|
|
echo "\u001b[34m"
|
2023-04-18 10:05:16 +00:00
|
|
|
echo "HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH"
|
|
|
|
echo "HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH"
|
|
|
|
echo "HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH"
|
|
|
|
echo "HHHHHHHHHHHH .HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH"
|
|
|
|
echo "HHHHHHHHHHH. ,HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH"
|
|
|
|
echo "HHHHHHHHHHHHH.## HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH"
|
2023-04-22 19:44:43 +00:00
|
|
|
echo "HHHHHHHHHHHHHHHHHHH#.HHHHH_*,*,*,*,*,*,*,*,***,*,**#HHHHHHHHHHHHHHHHHHHHHHHHHHHH"
|
2023-04-18 10:05:16 +00:00
|
|
|
echo "HHHHHHHHHHHHHHHHHHHHH.*,,***,***,***,***,***,***,*******HHHHHHHHHHHHHHHHHHHHHHHH"
|
|
|
|
echo "HHHHHHHHHHHHHHHHHHH*,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,*,,,,,HHHHHHHHHHHHHHHHHHHHH"
|
2023-04-22 19:44:43 +00:00
|
|
|
echo "HHHHHHHHHHHHHHHHH.,,,***,***,***,***,***,***,***,***,***,***_HHHHHHHHHHHHHHHHHHH"
|
2023-04-18 10:05:16 +00:00
|
|
|
echo "HHHHHHHHHHHHHHHH*,,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*HHHHHHHHHHHHHHHHHH"
|
|
|
|
echo "HHHHHHHHHHHHHHH#,***,***,***,***,***,***,***,***,***,***,***,**HHHHHHHHHHHHHHHHH"
|
|
|
|
echo "HHHHHHHHHH..HHH,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,*#HHHHHHHHHHHHHHHH"
|
2023-04-22 19:44:43 +00:00
|
|
|
echo "HHHHHHH,,,**,_H*,***,***,***,,,*,***,***,***,**,,,**,***,***,***H,,*,***HHHHHHHH"
|
|
|
|
echo "HHHHHH.*,,,*,,,,,*,*,*,***#HHHHH.,,*,*,*,*,**_HHHHH.,*,*,*,*,*,*,*,*****HHHHHHHH"
|
|
|
|
echo "HHHHHH.*,***,*,*,***,***,.HHHHHHH_**,***,****HHHHHHH.***,***,***,*******HHHHHHHH"
|
2023-04-18 10:05:16 +00:00
|
|
|
echo "HHHHHH.,,,,,,,,,,,,,,,,,,,.HHHHH.,,,,,,,,,,,,.HHHHHH,,,,,,,,,,,,,,,,,***HHHHHHHH"
|
2023-04-22 19:44:43 +00:00
|
|
|
echo "HHHHHH.,,,,,,_H,,,**,***,***,,,*,***,***,***,**,,,,*,***,***,***H***,***HHHHHHHH"
|
|
|
|
echo "HHHHHHH.,,,,*.H,,,,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,***H*,,,,_HHHHHHHHH"
|
2023-04-18 10:05:16 +00:00
|
|
|
echo "HHHHHHHHHHHHHHH*,***,***,**,,***,***,***,***,***,***,***,***,**.HHHHHHHHHHHHHHHH"
|
|
|
|
echo "HHHHHHHHHHHHHHHH,,,,,,,,*,,#H#,,,,,*,,,*,,,,,,,,*#H*,,,,,,,,,**HHHHHHHHHHHHHHHHH"
|
2023-04-22 19:44:43 +00:00
|
|
|
echo "HHHHHHHHHHHHHHHHH,,*,***,***,**_.HHHHHHHHHHHHH#*,,,*,***,***,*HHHHHHHHHHHHHHHHHH"
|
2023-04-18 10:05:16 +00:00
|
|
|
echo "HHHHHHHHHHHHHHHHHH,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*HHHHHHHHHHHHHHHHHH"
|
|
|
|
echo "HHHHHHHHHHHHHHHHHH**,***,***,***,***,***,***,***,***,***,***,*.HHHHHHHHHHHHHHHHH"
|
|
|
|
echo "HHHHHHHHHHHHHHHHHH*,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,*HHHHHHHHHHHHHHHHH"
|
2023-04-22 19:44:43 +00:00
|
|
|
echo "HHHHHHHHHHHHHHHHHH**,***,***,*******_..HHHHHHHHH.#_*,*,,,***,***HHHHHHHHHHHHHHHH"
|
|
|
|
echo "HHHHHHHHHHHHHHHHH*,*,*,******#HHHHHHHHHHHHHHHHHHHHHHHHHHHH._**,,,.HHHHHHHHHHHHHH"
|
2023-04-18 10:05:16 +00:00
|
|
|
echo "HHHHHHHHHHHHHHHH.,,*,***.HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH.*#HHHHHHHHHHHH"
|
2023-04-22 19:44:43 +00:00
|
|
|
echo "HHHHHHHHHHHHHHH_,,,*.HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH"
|
2023-04-18 10:05:16 +00:00
|
|
|
echo "HHHHHHHHHHHHHH,,#HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH"
|
|
|
|
echo "HHHHHHHHHHHH.HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH"
|
|
|
|
echo "HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH"
|
|
|
|
echo "HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH"
|
|
|
|
echo "HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH"
|
2023-06-12 14:25:24 +00:00
|
|
|
echo "\u001b[0m"
|
2023-04-18 14:54:19 +00:00
|
|
|
|
2023-04-28 08:07:58 +00:00
|
|
|
if ping -q -c 1 google.com >/dev/null 2>&1; then
|
|
|
|
echo -e "\e[32mInternet Connection working fine\e[0m"
|
|
|
|
# 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
|
2023-04-18 14:54:19 +00:00
|
|
|
|
2023-05-23 01:43:09 +00:00
|
|
|
# Check if repository exists
|
2023-04-28 08:07:58 +00:00
|
|
|
if [[ -d .git ]] ;then
|
2023-05-23 01:43:09 +00:00
|
|
|
echo Pulling latest changes
|
2023-06-23 06:05:43 +00:00
|
|
|
git pull
|
2023-04-28 08:07:58 +00:00
|
|
|
else
|
2023-06-10 14:09:57 +00:00
|
|
|
if [[ -d lollms-webui ]] ;then
|
|
|
|
cd lollms-webui
|
2023-04-28 08:07:58 +00:00
|
|
|
else
|
|
|
|
echo Cloning repository...
|
|
|
|
rem Clone the Git repository into a temporary directory
|
2023-06-10 14:09:57 +00:00
|
|
|
git clone https://github.com/ParisNeo/lollms-webui.git ./lollms-webui
|
|
|
|
cd lollms-webui
|
2023-04-28 08:07:58 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
echo Pulling latest version...
|
|
|
|
git pull
|
2023-04-19 08:35:46 +00:00
|
|
|
|
2023-04-28 08:07:58 +00:00
|
|
|
# Install Python 3.10 and pip
|
2023-06-24 10:58:26 +00:00
|
|
|
echo -n "Checking for python3..."
|
|
|
|
if command -v python3 > /dev/null 2>&1; then
|
2023-04-28 08:07:58 +00:00
|
|
|
echo "is installed"
|
|
|
|
else
|
2023-06-24 10:58:26 +00:00
|
|
|
read -p "python3 is not installed. Would you like to install python3? [Y/N] " choice
|
2023-04-28 08:07:58 +00:00
|
|
|
if [ "$choice" = "Y" ] || [ "$choice" = "y" ]; then
|
2023-06-24 10:58:26 +00:00
|
|
|
echo "Installing python3..."
|
2023-04-28 08:07:58 +00:00
|
|
|
sudo apt update
|
2023-06-24 10:58:26 +00:00
|
|
|
sudo apt install -y python3 python3-venv
|
2023-04-28 08:07:58 +00:00
|
|
|
else
|
2023-06-24 10:58:26 +00:00
|
|
|
echo "Please install python3 and try again."
|
2023-04-28 08:07:58 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
2023-04-19 08:35:46 +00:00
|
|
|
|
2023-04-28 08:07:58 +00:00
|
|
|
# Install venv module
|
|
|
|
echo -n "Checking for venv module..."
|
2023-06-24 10:58:26 +00:00
|
|
|
if python3 -m venv env > /dev/null 2>&1; then
|
2023-04-28 08:07:58 +00:00
|
|
|
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
|
2023-06-24 10:58:26 +00:00
|
|
|
sudo apt install -y python3-venv
|
2023-04-28 08:07:58 +00:00
|
|
|
else
|
|
|
|
echo "Please install venv module and try again."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Create a new virtual environment
|
|
|
|
echo -n "Creating virtual environment..."
|
2023-06-24 10:58:26 +00:00
|
|
|
python3 -m venv env
|
2023-04-28 08:07:58 +00:00
|
|
|
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
|
2023-05-14 13:13:05 +00:00
|
|
|
fi
|
2023-04-28 08:07:58 +00:00
|
|
|
|
2023-05-14 08:35:30 +00:00
|
|
|
|
2023-04-19 08:35:46 +00:00
|
|
|
# Activate the virtual environment
|
|
|
|
echo -n "Activating virtual environment..."
|
|
|
|
source env/bin/activate
|
|
|
|
echo "is active"
|
|
|
|
|
|
|
|
# Install the required packages
|
|
|
|
echo "Installing requirements..."
|
2023-06-24 10:58:26 +00:00
|
|
|
python3 -m pip install pip --upgrade
|
|
|
|
python3 -m pip install --upgrade -r requirements.txt
|
2023-04-19 08:35:46 +00:00
|
|
|
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo "Failed to install required packages. Please check your internet connection and try again."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-04-22 19:47:40 +00:00
|
|
|
|
2023-04-19 08:35:46 +00:00
|
|
|
# Cleanup
|
|
|
|
|
|
|
|
if [ -d "./tmp" ]; then
|
|
|
|
rm -rf "./tmp"
|
|
|
|
echo "Cleaning tmp folder"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Launch the Python application
|
|
|
|
python app.py
|