Gemma training script
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
#SIA_INSTALL_NO_ITB=1
|
||||
#SIA_INSTALL_NO_TRAIN=1
|
||||
#SIA_INSTALL_NO_NOTEBOOK=1
|
||||
#SIA_INSTALL_NO_WEB=1
|
||||
SIA_INSTALL_NO_NOTEBOOK=1
|
||||
#SIA_INSTALL_NO_CORE=1
|
||||
SIA_INSTALL_NO_ITB=1
|
||||
SIA_INSTALL_NO_MISTRAL_INFER=1
|
||||
#SIA_INSTALL_NO_GEMMA_INFER=1
|
||||
#SIA_INSTALL_NO_GEMMA_TRAIN=1
|
||||
|
||||
trap 'return 1' ERR
|
||||
|
||||
@@ -29,11 +32,14 @@ apt-get install -y \
|
||||
build-essential \
|
||||
cmake \
|
||||
cuda-toolkit \
|
||||
curl \
|
||||
git \
|
||||
gnupg \
|
||||
jq \
|
||||
libcurl4-nss-dev \
|
||||
python3-dev \
|
||||
python3-venv \
|
||||
tmux \
|
||||
vim \
|
||||
wget \
|
||||
;
|
||||
@@ -48,18 +54,15 @@ if [ -z "${SIA_INSTALL_NO_ITB}" ]; then
|
||||
fi
|
||||
|
||||
# Install Rust
|
||||
if [ -z "${SIA_INSTALL_NO_TRAIN}" ]; then
|
||||
curl https://sh.rustup.rs -sSf | bash -s -- -y
|
||||
export PATH="/root/.cargo/bin:${PATH}"
|
||||
fi
|
||||
curl https://sh.rustup.rs -sSf | bash -s -- -y
|
||||
export PATH="/root/.cargo/bin:${PATH}"
|
||||
|
||||
# Install Node.js
|
||||
if [ -z "${SIA_INSTALL_NO_CORE}" ]; then
|
||||
echo "Installing Node.js..."
|
||||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
|
||||
export NVM_DIR="/root/.nvm"
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
||||
nvm install node
|
||||
export NVM_DIR=/root/.nvm
|
||||
. "$NVM_DIR/nvm.sh" && nvm install node
|
||||
fi
|
||||
|
||||
# Install llama.cpp
|
||||
@@ -87,36 +90,14 @@ if [ ! -d "/root/sia" ]; then
|
||||
git config --global core.editor vim
|
||||
fi
|
||||
|
||||
# Build web interface
|
||||
if [ -z "${SIA_INSTALL_NO_CORE}" ]; then
|
||||
echo "Building web interface"
|
||||
cd "/root/sia/web"
|
||||
npm install
|
||||
npm run build
|
||||
ln -s "/root/sia/web/dist" "/root/static"
|
||||
fi
|
||||
|
||||
# Install SIA dependencies
|
||||
cd /root/desktop
|
||||
source "/root/sia/scripts/install.sh"
|
||||
|
||||
# Add venvs to path in .bashrc
|
||||
if ! grep -q "source /root/sia/scripts/add_venvs_to_path.sh" /root/.bashrc; then
|
||||
echo 'source /root/sia/scripts/add_venvs_to_path.sh' >> /root/.bashrc
|
||||
fi
|
||||
|
||||
# Add venvs to path in profile
|
||||
if ! grep -q "source /root/sia/scripts/add_venvs_to_path.sh" /etc/profile; then
|
||||
echo 'source /root/sia/scripts/add_venvs_to_path.sh' >> /etc/profile
|
||||
fi
|
||||
|
||||
# Add venvs to path in current shell
|
||||
source /root/sia/scripts/add_venvs_to_path.sh
|
||||
|
||||
# Finetune model
|
||||
if [ -z "${SIA_INSTALL_NO_TRAIN}" ]; then
|
||||
echo "Finetuning model..."
|
||||
train /root/models/bootstrap
|
||||
/root/sia/scripts/train.sh /root/models/bootstrap
|
||||
ln -s /root/models/bootstrap /root/models/current
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user