Gemma training script

This commit is contained in:
Niels Geens
2025-05-20 20:46:16 +02:00
parent d4a4902b94
commit f2c70cd05d
14 changed files with 394 additions and 207 deletions

View File

@@ -1,46 +1,68 @@
#!/bin/bash
#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_TRAIN=1
#SIA_INSTALL_NO_GEMMA_TRAIN=1
cd "/root/desktop"
if [ -z "${SIA_INSTALL_NO_WEB}" ]; then
echo "Building web interface"
(
cd "/root/sia/web"
npm install
npm run build
ln -s "/root/sia/web/dist" "/root/static"
)
fi
if [ -z "${SIA_INSTALL_NO_NOTEBOOK}" ]; then
echo "Installing venv for running notebooks..."
echo "Installing venv for running notebooks"
python3 -m venv /root/venvs/notebook
/root/venvs/notebook/bin/pip install jupyter ipykernel ipywidgets
/root/venvs/notebook/bin/ipython kernel install --name=notebook
fi
if [ -z "${SIA_INSTALL_NO_CORE}" ]; then
echo "Installing SIA core..."
echo "Installing SIA core"
python3 -m venv /root/venvs/sia
/root/venvs/sia/bin/pip install -e /root/sia
fi
if [ -z "${SIA_INSTALL_NO_ITB}" ]; then
echo "Installing ITB tool..."
echo "Installing ITB tool"
python3 -m venv /root/venvs/itb
/root/venvs/itb/bin/pip install -e /root/sia/tools/itb
fi
if [ -z "${SIA_INSTALL_NO_MISTRAL_INFER}" ]; then
echo "Installing venv for mistral inference..."
echo "Installing venv for mistral inference"
python3 -m venv /root/venvs/mistral_infer
/root/venvs/mistral_infer/bin/pip install -e /root/sia/tools/mistral_infer
fi
if [ -z "${SIA_INSTALL_NO_GEMMA_INFER}" ]; then
echo "Installing venv for gemma inference..."
echo "Installing venv for gemma inference"
python3 -m venv /root/venvs/gemma_infer
/root/venvs/gemma_infer/bin/pip install -e /root/sia/tools/gemma_infer
fi
if [ -z "${SIA_INSTALL_NO_TRAIN}" ]; then
echo "Installing Train tool..."
python3 -m venv /root/venvs/train
/root/venvs/train/bin/pip install -e /root/sia/tools/train
/root/venvs/train/bin/ipython kernel install --name=train
fi
if [ -z "${SIA_INSTALL_NO_GEMMA_TRAIN}" ]; then
echo "Installing venv for gemma training"
python3 -m venv /root/venvs/gemma_train
/root/venvs/gemma_train/bin/pip install -e /root/sia/tools/gemma_train
fi
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
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
source /root/sia/scripts/add_venvs_to_path.sh