CI(notebooks): api-introspect installs unsloth from local checkout

The api-introspect job was pulling PyPI's `unsloth` via
`pip install --no-deps unsloth`. Latest released PyPI unsloth lacks
the CPU-torch fallback in unsloth/kernels/utils.py (lines 162-170)
that this branch carries, so `import unsloth` crashes with
AttributeError on `torch._C._cuda_getCurrentRawStream` (CPU torch
doesn't compile that symbol).

Switch to `pip install --no-deps -e ./unsloth` so the api-introspect
job validates the code in THIS PR head, not whatever's currently on
PyPI. unsloth_zoo continues to come from PyPI since the PR doesn't
modify unsloth_zoo.
This commit is contained in:
Daniel Han 2026-05-07 12:58:34 +00:00
parent 86e31c98bb
commit f3e541dd12

View file

@ -215,7 +215,12 @@ jobs:
Pillow safetensors tqdm packaging psutil
# Converter deps (nbformat for notebook_to_python.py).
pip install 'nbformat>=5.10' 'nbconvert>=7.16'
pip install --no-deps unsloth_zoo unsloth
# Install unsloth from the LOCAL checkout (the PR head), not PyPI.
# The PR-time CI must validate the code in this PR; PyPI unsloth
# may lag the in-repo CPU-torch fallback in unsloth/kernels/utils.py
# (lines 162-170) that handles missing torch._C._cuda_getCurrentRawStream.
pip install --no-deps unsloth_zoo
pip install --no-deps -e ./unsloth
- name: Convert notebooks for AST scan
# Same upstream-conversion-error tolerance as the static job.