Repository navigation
Commit 9dd1d7e
Native backend: keep the HF exporters working with transformers 4
Summary:
#24422 moved the native HF exporters to the transformers 5 cache API, but some builds still use transformers 4.57. There `StaticLayer.lazy_initialization` takes only the keys, so `PositionedStaticLayer.replacing` raised a `TypeError` and every hf_llm, Whisper and cross-engine export failed. Pass the arguments the installed version takes. `--gguf` now imports `init_empty_weights` from `accelerate`, so add it to the Buck deps. transformers 4 builds Gemma 3's sliding-window layers as `StaticSlidingWindowLayer`, whose KV dtype can't change, so the Gemma 3 fp16 case of `test_cache_writes_index_the_cache_position_input` is skipped in fbcode.
Authored with Metamate (agentcloud).
Reviewed By: shoumikhin
Differential Revision: D1306971761 parent f8373ec commit 9dd1d7e
3 files changed
Lines changed: 13 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| 52 | + | |
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
38 | | - | |
39 | | - | |
40 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
41 | 46 | | |
42 | 47 | | |
43 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
320 | 321 | | |
321 | 322 | | |
322 | 323 | | |
| 324 | + | |
| 325 | + | |
323 | 326 | | |
324 | 327 | | |
325 | 328 | | |
| |||
0 commit comments