upgraded macos

This commit is contained in:
Saifeddine ALOUI 2023-10-19 23:30:18 +02:00
parent 0ae483be39
commit 34f04bb427
6 changed files with 35 additions and 24 deletions

View File

@ -41,18 +41,21 @@ echo "B) Run CPU mode"
echo
read -rp "Input> " gpuchoice
gpuchoice="${gpuchoice:0:1}"
if [[ "${gpuchoice^^}" == "A" ]]; then
PACKAGES_TO_INSTALL="python=3.10 cuda-toolkit ninja git gcc"
uppercase_gpuchoice=$(echo "$gpuchoice" | tr '[:lower:]' '[:upper:]')
if [[ "$uppercase_gpuchoice" == "A" ]]; then
PACKAGES_TO_INSTALL="python=3.10 cuda-toolkit ninja git"
CHANNEL="-c pytorch -c conda-forge"
elif [[ "${gpuchoice^^}" == "B" ]]; then
PACKAGES_TO_INSTALL="python=3.10 ninja git gcc"
elif [[ "$uppercase_gpuchoice" == "B" ]]; then
PACKAGES_TO_INSTALL="python=3.10 ninja git"
CHANNEL="-c conda-forge"
else
echo "Invalid choice. Exiting..."
exit 1
fi
echo "Installing gcc..."
brew install gcc
# Better isolation for virtual environment
unset CONDA_SHLVL
export PYTHONNOUSERSITE=1
@ -63,6 +66,7 @@ export TMP="$PWD/installer_files/temp"
MINICONDA_DIR="$PWD/installer_files/miniconda3"
INSTALL_ENV_DIR="$PWD/installer_files/lollms_env"
ENV_NAME="lollms"
MINICONDA_DOWNLOAD_URL="https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh"
REPO_URL="https://github.com/ParisNeo/lollms-webui.git"
@ -89,22 +93,20 @@ source "$MINICONDA_DIR/bin/activate" || ( echo "Miniconda hook not found." && ex
# Create the installer environment
if [ ! -d "$INSTALL_ENV_DIR" ]; then
echo "Packages to install: $PACKAGES_TO_INSTALL"
conda create -y -k -p "$INSTALL_ENV_DIR" $CHANNEL $PACKAGES_TO_INSTALL || ( echo && echo "Conda environment creation failed." && exit 1 )
if [[ "${gpuchoice^^}" == "A" ]]; then
conda run --live-stream -p "$INSTALL_ENV_DIR" python -m pip install torch torchvision torchaudio --channel pytorch --channel conda-forge || ( echo && echo "Pytorch installation failed." && exit 1 )
elif [[ "${gpuchoice^^}" == "B" ]]; then
conda run --live-stream -p "$INSTALL_ENV_DIR" python -m pip install torch torchvision torchaudio --channel pytorch --channel conda-forge || ( echo && echo "Pytorch installation failed." && exit 1 )
conda create -y -k -n "$ENV_NAME" $CHANNEL $PACKAGES_TO_INSTALL || ( echo && echo "Conda environment creation failed." && exit 1 )
echo "Conda created and using packages: $PACKAGES_TO_INSTALL"
echo "Installing tools"
if [[ "$(echo $gpuchoice | tr '[:lower:]' '[:upper:]')" == "A" ]]; then
conda run --live-stream -n "$ENV_NAME" python -m pip install torch torchvision torchaudio --channel pytorch --channel conda-forge || ( echo && echo "Pytorch installation failed." && exit 1 )
elif [[ "$(echo $gpuchoice | tr '[:lower:]' '[:upper:]')" == "B" ]]; then
conda run --live-stream -n "$ENV_NAME" python -m pip install torch torchvision torchaudio --channel pytorch --channel conda-forge || ( echo && echo "Pytorch installation failed." && exit 1 )
fi
fi
# Check if conda environment was actually created
if [ ! -x "$INSTALL_ENV_DIR/bin/python" ]; then
echo && echo "Conda environment is empty." && exit 1
fi
# Activate installer environment
source activate "$INSTALL_ENV_DIR" || ( echo && echo "Conda environment activation failed." && exit 1 )
source activate "$ENV_NAME" || ( echo && echo "Conda environment activation failed." && exit 1 )
echo "$ENV_NAME Activated"
# Set default CUDA toolkit to the one in the environment
export CUDA_PATH="$INSTALL_ENV_DIR"
@ -153,7 +155,8 @@ else
cp scripts/macos/macos_update.sh ../
fi
if [[ "${gpuchoice^^}" == "B" ]]; then
uppercase_gpuchoice=$(echo "$gpuchoice" | tr '[:lower:]' '[:upper:]')
if [[ "$uppercase_gpuchoice" == "B" ]]; then
echo "This is a .no_gpu file." > .no_gpu
else
echo "GPU is enabled, no .no_gpu file will be created."

View File

@ -22,7 +22,8 @@ PYTHONPATH=""
PYTHONHOME=""
TEMP="./installer_files/temp"
TMP="./installer_files/temp"
INSTALL_ENV_DIR="./installer_files/lollms_env"
ENV_NAME="lollms"
INSTALL_ENV_DIR="./installer_files/miniconda3/envs/lollms"
MINICONDA_DIR="./installer_files/miniconda3"
if [ ! -f "$MINICONDA_DIR/bin/activate" ]; then
@ -30,7 +31,7 @@ if [ ! -f "$MINICONDA_DIR/bin/activate" ]; then
exit 1
fi
source "$MINICONDA_DIR/bin/activate" "$INSTALL_ENV_DIR"
source "$MINICONDA_DIR/bin/activate" "$ENV_NAME"
cd lollms-webui
# Set default CUDA toolkit to the one in the environment

View File

@ -22,7 +22,8 @@ PYTHONPATH=""
PYTHONHOME=""
TEMP="./installer_files/temp"
TMP="./installer_files/temp"
INSTALL_ENV_DIR="./installer_files/lollms_env"
ENV_NAME="lollms"
INSTALL_ENV_DIR="./installer_files/miniconda3/envs/lollms"
MINICONDA_DIR="./installer_files/miniconda3"
if [ ! -f "$MINICONDA_DIR/bin/activate" ]; then
@ -30,7 +31,7 @@ if [ ! -f "$MINICONDA_DIR/bin/activate" ]; then
exit 1
fi
source "$MINICONDA_DIR/bin/activate" "$INSTALL_ENV_DIR"
source "$MINICONDA_DIR/bin/activate" "$ENV_NAME"
cd lollms-webui
echo "Pulling latest changes"

View File

@ -125,6 +125,7 @@
:title="selectedModel"
:execute_cmd="setModel"
:icon="models_menu_icon"
:menu-icon-class="'rounded-full'"
:commands="commandify(models)"
:selected_entry="selectedModel"></InteractiveMenu>
<div v-if="selecting_model" title="Selecting model" class="flex flex-row flex-grow justify-end">
@ -298,7 +299,7 @@ export default {
showfilesList: true,
showPersonalities: false,
personalities_ready: false,
models_menu_icon:'#M'
models_menu_icon:""
}
},
computed: {

View File

@ -1,6 +1,6 @@
<template>
<div class="menu-container">
<button @click.prevent="toggleMenu" :title="title" class="menu-button m-0 p-0 bg-blue-500 text-white dark:bg-blue-200 dark:text-gray-800 rounded flex items-center justify-center w-6 h-6 border-none cursor-pointer hover:bg-blue-400 w-8 h-8 object-fill text-red-700 border-2 active:scale-90 hover:z-20 hover:-translate-y-2 duration-150 border-gray-300 border-secondary cursor-pointer" ref="menuButton">
<button @click.prevent="toggleMenu" :title="title" :class="menuIconClass" class="menu-button m-0 p-0 bg-blue-500 text-white dark:bg-blue-200 dark:text-gray-800 rounded flex items-center justify-center w-6 h-6 border-none cursor-pointer hover:bg-blue-400 w-8 h-8 object-fill text-red-700 border-2 active:scale-90 hover:z-20 hover:-translate-y-2 duration-150 border-gray-300 border-secondary cursor-pointer" ref="menuButton">
<img v-if="icon && !icon.includes('#') && !icon.includes('feather')" :src="icon" class="w-5 h-5 p-0 m-0 shadow-lg bold">
<i v-else-if="icon && icon.includes('feather')" :data-feather="icon.split(':')[1]" class="w-5 h-5"></i>
<p v-else-if="icon && icon.includes('#')" class="w-5 h-5">{{ icon.split('#')[1] }}</p>
@ -49,6 +49,11 @@ export default {
type: Function, // The execute_cmd property should be a function
required: false
},
menuIconClass: {
type: String,
required: false,
default:""
},
selected_entry: {
type: String,
required: false

@ -1 +1 @@
Subproject commit b0eed950178f3bcc8e2c01ec592dcb1c6037c58f
Subproject commit fdb24be0d69303d75ca9591c890301a9c954a0a6