Spaces:
Paused
Paused
Update start_server.sh
Browse files- start_server.sh +19 -3
start_server.sh
CHANGED
|
@@ -1,13 +1,28 @@
|
|
| 1 |
#!/bin/bash
|
|
|
|
|
|
|
| 2 |
JUPYTER_TOKEN="${JUPYTER_TOKEN:=huggingface}"
|
| 3 |
|
|
|
|
| 4 |
NOTEBOOK_DIR="/data"
|
| 5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
jupyter labextension disable "@jupyterlab/apputils-extension:announcements"
|
| 7 |
|
|
|
|
| 8 |
jupyter-lab \
|
| 9 |
-
--ip
|
| 10 |
-
--port
|
| 11 |
--no-browser \
|
| 12 |
--allow-root \
|
| 13 |
--ServerApp.token="$JUPYTER_TOKEN" \
|
|
@@ -16,4 +31,5 @@ jupyter-lab \
|
|
| 16 |
--ServerApp.disable_check_xsrf=True \
|
| 17 |
--LabApp.news_url=None \
|
| 18 |
--LabApp.check_for_updates_class="jupyterlab.NeverCheckForUpdate" \
|
| 19 |
-
--
|
|
|
|
|
|
| 1 |
#!/bin/bash
|
| 2 |
+
|
| 3 |
+
# Set default token if not provided
|
| 4 |
JUPYTER_TOKEN="${JUPYTER_TOKEN:=huggingface}"
|
| 5 |
|
| 6 |
+
# Set notebook working directory
|
| 7 |
NOTEBOOK_DIR="/data"
|
| 8 |
|
| 9 |
+
# Disable extension manager cleanly via settings override
|
| 10 |
+
export JUPYTERLAB_SETTINGS_DIR=/tmp/jupyterlab-settings
|
| 11 |
+
mkdir -p "$JUPYTERLAB_SETTINGS_DIR"
|
| 12 |
+
|
| 13 |
+
echo '{
|
| 14 |
+
"@jupyterlab/extensionmanager-extension:plugin": {
|
| 15 |
+
"enabled": false
|
| 16 |
+
}
|
| 17 |
+
}' > "$JUPYTERLAB_SETTINGS_DIR/overrides.json"
|
| 18 |
+
|
| 19 |
+
# Optional: Disable announcements (already in your original)
|
| 20 |
jupyter labextension disable "@jupyterlab/apputils-extension:announcements"
|
| 21 |
|
| 22 |
+
# Launch JupyterLab
|
| 23 |
jupyter-lab \
|
| 24 |
+
--ip=0.0.0.0 \
|
| 25 |
+
--port=7860 \
|
| 26 |
--no-browser \
|
| 27 |
--allow-root \
|
| 28 |
--ServerApp.token="$JUPYTER_TOKEN" \
|
|
|
|
| 31 |
--ServerApp.disable_check_xsrf=True \
|
| 32 |
--LabApp.news_url=None \
|
| 33 |
--LabApp.check_for_updates_class="jupyterlab.NeverCheckForUpdate" \
|
| 34 |
+
--LabApp.app_settings_directory="$JUPYTERLAB_SETTINGS_DIR" \
|
| 35 |
+
--notebook-dir="$NOTEBOOK_DIR"
|