Commit 8b25d27
fix(_bert): pin revision on transformers v5 PEFT adapter probe
When PEFT is installed, transformers v5 calls find_adapter_config_file
on every AutoModelForSequenceClassification.from_pretrained. The
auto_factory only propagates `_commit_hash` (used for the cache
lookup) but NOT the outer `revision` to the fall-through
hf_hub_download. On a cold cache — i.e. our CI warm-cache job, which
populates model files but no negative marker for adapter_config.json —
that probe fires `hf_hub_download(repo_id, adapter_config.json,
revision=None)` and our test guard rightly flagged it as unpinned.
Pass `adapter_kwargs={"revision": revision}` so the adapter probe
inherits the pin. The first run still writes a `.no_exist` marker, but
all subsequent runs (and CI's pinned-only contract) stay clean.
Reproduces with: rm -rf ~/.cache/huggingface/hub/models--prajjwal1--bert-tiny/.no_exist
then pytest tests/pipeline/test_inference.py::test_inference_from_config[multiclass].
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 35e6394 commit 8b25d27
1 file changed
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
139 | 145 | | |
140 | 146 | | |
141 | 147 | | |
142 | | - | |
| 148 | + | |
143 | 149 | | |
144 | 150 | | |
145 | 151 | | |
146 | 152 | | |
| 153 | + | |
147 | 154 | | |
148 | 155 | | |
149 | 156 | | |
| |||
0 commit comments