Compare commits
4 Commits
606b6c8ff9
...
main
Author | SHA1 | Date | |
---|---|---|---|
d41a25b366 | |||
3c382e96cb | |||
cb5ba1e0c1 | |||
db8d3ef52b |
10
helper.sh
10
helper.sh
@ -13,7 +13,7 @@ Available flags:
|
||||
t, -t, tensorboard, --tensorboard Launch Tensorboard locally to the script (Require installation beforehand).
|
||||
h, -h, help, --help Which display this help message."
|
||||
|
||||
VENV_PATH=./venv
|
||||
VENV_PATH=./.venv
|
||||
JUPYTER_ROOT_PATH=./jupyter
|
||||
TENSORBOARD_LOG_DIR=./logs
|
||||
export R_LIBS_SITE=./libs
|
||||
@ -40,7 +40,7 @@ enable_venv(){
|
||||
case "$1" in
|
||||
i|-i|install|--install)
|
||||
python -m venv --upgrade-deps "$VENV_PATH"
|
||||
mkdir -pv "$JUPYTERLAB_SETTINGS_DIR"/@jupyterlab/{notebook-extension,extensionmanager-extension,apputils-extension}
|
||||
mkdir -p "$JUPYTERLAB_SETTINGS_DIR"/@jupyterlab/{notebook-extension,extensionmanager-extension,apputils-extension}
|
||||
# Setting it to zero doesn't have the expected result, therefore, let's set it to an abnormally large number.
|
||||
echo '{ "maxNumberOutputs": 10000000000 }' > "$JUPYTERLAB_SETTINGS_DIR"/@jupyterlab/notebook-extension/tracker.jupyterlab-settings
|
||||
echo '{ "disclaimed": true }' > "$JUPYTERLAB_SETTINGS_DIR"/@jupyterlab/extensionmanager-extension/plugin.jupyterlab-settings
|
||||
@ -54,7 +54,7 @@ case "$1" in
|
||||
enable_venv "$2"
|
||||
mkdir -pv "$R_LIBS_SITE"
|
||||
if command -v Rscript >> /dev/null; then
|
||||
Rscript -e 'install.packages("IRkernel",repos="http://cran.r-project.org");library(IRkernel);IRkernel::installspec()'
|
||||
Rscript -e "install.packages('IRkernel','$R_LIBS_SITE','http://cran.r-project.org');library(IRkernel);IRkernel::installspec()"
|
||||
else
|
||||
echo "R isn't installed"
|
||||
exit 1
|
||||
@ -73,13 +73,13 @@ case "$1" in
|
||||
;;
|
||||
|
||||
U|-U|uninstall|--uninstall)
|
||||
rm -rfv "$VENV_PATH" "$JUPYTER_ROOT_PATH" "$R_LIBS_SITE" .ipynb_checkpoints __pycache__
|
||||
rm -rf "$VENV_PATH" "$JUPYTER_ROOT_PATH" "$R_LIBS_SITE" .ipynb_checkpoints __pycache__
|
||||
;;
|
||||
|
||||
l|-l|launch|--launch)
|
||||
enable_venv "$2"
|
||||
if command -v jupyter >> /dev/null; then
|
||||
exec jupyter lab --ip 0.0.0.0 --ServerApp.iopub_data_rate_limit 1e16
|
||||
exec jupyter lab --ip 0.0.0.0
|
||||
else
|
||||
echo "Jupyter lab isn't installed"
|
||||
exit 1
|
||||
|
Reference in New Issue
Block a user