docker: add the AGPL-3.0 SPDX header to the new Python files
Every new .py this PR adds now carries the same two-line SPDX header the other new files in the branch already use (docker/jupyter/unsloth_branding.py), with the shebang kept first where present. Matches the licensing laid out in docker/NOTICE: the image bundles Studio (AGPL-3.0) while Unsloth Core stays Apache-2.0.
This commit is contained in:
parent
1c39a283f6
commit
4cfc63e74f
15 changed files with 45 additions and 22 deletions
|
|
@ -1,3 +1,6 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
# Copyright 2026-Present the Unsloth team. See /studio/LICENSE.AGPL-3.0
|
||||
|
||||
"""Bake a pinned llama.cpp prebuilt into the Docker image, deterministically.
|
||||
|
||||
Why not studio/install_llama_prebuilt.py: that resolver selects a bundle for
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
#!/usr/bin/env python3
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
# Copyright 2026-Present the Unsloth team. See /studio/LICENSE.AGPL-3.0
|
||||
|
||||
"""Install the Unsloth Studio sloth stickers for the JupyterLab login screen.
|
||||
|
||||
The branded login page (login.html) shows a different sloth sticker on each
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
# Copyright 2026-Present the Unsloth team. See /studio/LICENSE.AGPL-3.0
|
||||
|
||||
"""
|
||||
Smoke test for the unsloth-blackwell image.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
# Copyright 2026-Present the Unsloth team. See /studio/LICENSE.AGPL-3.0
|
||||
|
||||
"""Colab cell-magic compatibility for the Unsloth Docker notebooks.
|
||||
|
||||
Colab cells often look like:
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
# Copyright 2026-Present the Unsloth team. See /studio/LICENSE.AGPL-3.0
|
||||
|
||||
"""Baked IPython startup hook (copied to the profile's startup/ dir).
|
||||
|
||||
Runs once per kernel. Registers a pre_run_cell event that activates the right
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
# Copyright 2026-Present the Unsloth team. See /studio/LICENSE.AGPL-3.0
|
||||
|
||||
"""Per-notebook transformers version activation for the Unsloth Docker image.
|
||||
|
||||
Problem: unslothai/notebooks pin many different transformers versions in their
|
||||
|
|
|
|||
|
|
@ -1,26 +1,7 @@
|
|||
#!/usr/bin/env python3
|
||||
# Compare the *content* of two Unsloth notebooks, ignoring the auto-generated
|
||||
# top/bottom boilerplate that update_all_notebooks.py stamps on every notebook.
|
||||
#
|
||||
# Every generated notebook has the same shape:
|
||||
# - a "top" of boilerplate: the "To run this, press Runtime" announcement, the
|
||||
# "### News" / Unsloth Studio announcement cells, and the %%capture install
|
||||
# cell. These churn constantly (new pip pins, new announcements, new links).
|
||||
# - the "middle": the actual tutorial (data prep, train, inference, save).
|
||||
# - a "bottom": the "And we're done ... licensed LGPL-3.0" footer cell.
|
||||
#
|
||||
# The boot-time notebook refresh uses this to avoid rewriting a user's notebook
|
||||
# when only that boilerplate moved upstream. We hash ONLY the middle (the cells
|
||||
# that are not install/announcement/footer) and compare. Outputs, execution
|
||||
# counts, cell ids and metadata are ignored, so merely running a notebook never
|
||||
# changes the signature.
|
||||
#
|
||||
# Usage:
|
||||
# unsloth_nb_content_sig.py <a.ipynb> <b.ipynb> -> prints SAME | DIFF | ERR
|
||||
# unsloth_nb_content_sig.py <a.ipynb> -> prints the middle digest
|
||||
#
|
||||
# Exit code is always 0; the decision is the printed word. On any parse problem
|
||||
# we print ERR / nothing so the caller can fall back to its whole-file logic.
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
# Copyright 2026-Present the Unsloth team. See /studio/LICENSE.AGPL-3.0
|
||||
|
||||
import hashlib
|
||||
import json
|
||||
import sys
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
# Copyright 2026-Present the Unsloth team. See /studio/LICENSE.AGPL-3.0
|
||||
|
||||
"""Route notebook `%pip` / `%uv` / `python -m pip` installs through the shim.
|
||||
|
||||
The PATH shim (/opt/unsloth-nb/bin/{pip,pip3,uv} -> unsloth_pip_shim.py) only
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
#!/usr/bin/env python3
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
# Copyright 2026-Present the Unsloth team. See /studio/LICENSE.AGPL-3.0
|
||||
|
||||
# Remove the Colab-only "how to run" sentence from Unsloth notebooks for Docker.
|
||||
#
|
||||
# Every generated notebook opens with a first markdown cell whose first line is a
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
#!/usr/bin/env python3
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
# Copyright 2026-Present the Unsloth team. See /studio/LICENSE.AGPL-3.0
|
||||
|
||||
# Build a categorized, Colab-like folder VIEW of the Unsloth notebooks.
|
||||
#
|
||||
# The canonical notebooks live under DEST/nb/<file>.ipynb (a mirror of
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
#!/opt/unsloth-venv/bin/python
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
# Copyright 2026-Present the Unsloth team. See /studio/LICENSE.AGPL-3.0
|
||||
|
||||
"""pip / uv shim for the Unsloth Docker notebook environment.
|
||||
|
||||
Installed earlier on PATH than the real tools so a notebook's `!pip install ...`
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
#!/opt/unsloth-venv/bin/python
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
# Copyright 2026-Present the Unsloth team. See /studio/LICENSE.AGPL-3.0
|
||||
|
||||
"""unsloth-run: execute an unslothai/notebooks notebook unchanged, headless.
|
||||
|
||||
The robust driven path for the Docker image: it reads the notebook, figures out
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
# Copyright 2026-Present the Unsloth team. See /studio/LICENSE.AGPL-3.0
|
||||
|
||||
"""Regression tests for docker/unsloth_nb_pip_magic.py.
|
||||
|
||||
The input transformer rewrites explicit `!<python> -m pip|uv ...` shell lines
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
# Copyright 2026-Present the Unsloth team. See /studio/LICENSE.AGPL-3.0
|
||||
|
||||
"""Regression tests for docker/unsloth_pip_shim.py.
|
||||
|
||||
The shim sits ahead of the real pip/uv on PATH inside the Unsloth Docker
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
#!/usr/bin/env python3
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
# Copyright 2026-Present the Unsloth team. See /studio/LICENSE.AGPL-3.0
|
||||
|
||||
"""Cross-platform validation of the Unsloth Docker JupyterLab/notebook features.
|
||||
|
||||
Runs WITHOUT Docker or a GPU, so it can execute on the Linux/macOS/Windows CI
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue