You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2e0a679
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: CHANGELOG.md
+10-1Lines changed: 10 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,19 +7,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
8
8
## [0.8.10] - 2026-05-27
9
9
10
+
End-to-end fixes for the section 15 fine-tuning pipeline. The pipeline failed at multiple points; this release fixes them in sequence.
11
+
10
12
### Fixed
11
13
12
14
-`15-fine-tune/15-01-data-preparation.ipynb` failed at cell 3 with `ModuleNotFoundError: No module named 'torch'`. Two underlying issues: (1) `torch`, `transformers`, `peft`, `matplotlib`, `azure-storage-blob`, and `azure-ai-inference` were never declared in `pyproject.toml`, and (2) cell 2's inline `%pip install` silently failed in the uv-managed `.venv` (which doesn't ship `pip`, so `%pip` prints `No module named pip`). Same import-failure pattern would have hit `15-04-local-inference.ipynb`, which depends on torch/transformers/peft but had no install cell at all.
13
15
-`15-fine-tune/15-01-data-preparation.ipynb` cell 8 then failed with `OpenAIError: Missing credentials` because `FINETUNE_GATEWAY_KEY` was missing from `.env`. The Bicep at `15-fine-tune/main.bicep` does not create a dedicated `foundry-gateway-finetune` APIM subscription (unlike 10-01 / 11-01 which provision their own), so this env var was never going to be set. The teacher-model call only needs any valid APIM key, so the cell now reuses `ALPHA_GATEWAY_KEY` (already in `.env` from the project-spoke deployment). This removes a phantom env variable and one redundant Azure resource.
16
+
-`15-fine-tune/15-02-fine-tune.ipynb` ACA job failed with `The specified resource name length is not within the permissible limits`. Container name `"ft"` violated Azure Storage's 3-63 character minimum. The container creation silently failed (because the helper used `check=False`), then the in-job blob download from `"ft"` errored visibly. Renamed to `"finetune"` in 15-02 / 15-03 / 15-04 cell-3 constants and in `15-fine-tune/main.bicep` (which had the same bug). `azure_infra.py` takes the name as a parameter so no source change there.
17
+
-`15-fine-tune/15-03-evaluate.ipynb` raised `NameError: name 'eval_dataset' is not defined` when run in a fresh kernel. It implicitly relied on `eval_dataset` / `reports_data` / `env_id` / `accuracy` being in memory from 15-01 + 15-02. Cell 3 now re-derives all four: `eval_dataset` via `iss_utils.get_evaluation_dataset()`, `reports_data` via NASA fetch (~30s), `env_id` via `az containerapp env show`, and fallback teacher/base accuracies with comments explaining how to override. Also added `import pandas as pd` and `from IPython.display import display` to the imports cell (previously caused `NameError: pd not defined` in the comparison cell) and fixed an outdated `"DeepSeek-V3.2 (Teacher)"` label in the summary table to match the actual teacher (`gpt-4.1-mini`) used throughout the chain.
18
+
-`15-fine-tune/15-04-local-inference.ipynb` failed with `ImportError: cannot import name 'LossKwargs' from transformers.utils`. Phi-4-mini's custom remote modeling code (`modeling_phi3.py` from the Hugging Face hub) imports symbols (`LossKwargs`, etc.) that were removed in transformers 5.x. The `[finetune]` dep group's `transformers>=4.40.0` constraint allowed 5.x to be pulled in. Tightened to `>=4.46.0,<5.0.0` with a comment explaining the upper bound; matches the `transformers==4.53.3` pin the ACA fine-tune job uses inline.
19
+
-`15-fine-tune/15-04-local-inference.ipynb``generate()` emitted a "The attention mask is not set and cannot be inferred" warning because `apply_chat_template` returned just the input_ids tensor and Phi-4-mini has `pad_token == eos_token`. Reworked to use `apply_chat_template(..., return_dict=True)` and pass `**inputs` to `generate()` so both `input_ids` and `attention_mask` are present.
14
20
15
21
### Added
16
22
17
-
- New `[dependency-groups] finetune` entry in `pyproject.toml` declaring the heavy ML dependencies needed for section 15 (`torch>=2.0.0`, `transformers>=4.40.0`, `peft>=0.10.0`, `matplotlib>=3.7.0`, `azure-storage-blob>=12.20.0`, `azure-ai-inference>=1.0.0`). Users run `uv sync --group finetune` once before opening section 15. Base install stays lean for everyone else (~3 GB saved when section 15 isn't needed). Matches the pattern used for `azure-ai-evaluation[redteam]` in section 14.
23
+
- New `[dependency-groups] finetune` entry in `pyproject.toml` declaring the heavy ML dependencies needed for section 15 (`torch>=2.0.0`, `transformers>=4.46.0,<5.0.0`, `peft>=0.10.0`, `matplotlib>=3.7.0`, `azure-storage-blob>=12.20.0`, `azure-ai-inference>=1.0.0`). Users run `uv sync --group finetune` once before opening section 15. Base install stays lean for everyone else (~3 GB saved when section 15 isn't needed). Matches the pattern used for `azure-ai-evaluation[redteam]` in section 14.
24
+
- Committed `15-fine-tune/data/train.jsonl` (100-example synthetic+real distillation training set generated against the gpt-4.1-mini teacher). Useful as a fixed artifact so 15-02 can be re-run without regenerating the data (saves ~200 teacher calls), and readers can inspect what the LoRA trains on. The `15-fine-tune/data/` directory remains gitignored - `train.jsonl` is tracked explicitly via `git add -f`.
25
+
- New entries in `.gitignore` for section 15 artifacts that should not be committed by accident: `15-fine-tune/data/` (regenerable training JSONL), `15-fine-tune/models/` (~350MB of LoRA adapter weights), `15-fine-tune/eval_job.json` and `15-fine-tune/job.json` (contain real subscription IDs when written by local runs).
18
26
19
27
### Changed
20
28
21
29
- Cell 2 of `15-01-data-preparation.ipynb` converted from a broken `%pip install` code cell to a markdown cell that points readers at the `uv sync --group finetune` command and explains why `%pip` doesn't work in this venv.
22
30
- Updated `15-00-fine-tune.md` prerequisites: step 4 now specifies `uv sync --group finetune`, with a note explaining what the group includes and why the base install was kept lean. Step 2's `.env` block now references `ALPHA_GATEWAY_KEY` (no separate `FINETUNE_GATEWAY_KEY`), step 5's `az deployment` command uses `$ALPHA_GATEWAY_KEY` as `apimSubscriptionKey`. A note above the block explains the rationale.
31
+
- Reduced default `TARGET_TOTAL` in `15-01-data-preparation.ipynb` from 500 to 100 (demo-sized, ~200 teacher calls), with a rationale block above the constant and an expanded markdown header pointing readers at the literature's 500-2000 sweet spot for narrow classification distillation and noting that cost / runtime scale linearly with the knob.
0 commit comments