Commit f2fdfe5
feat: add ONNX export, hash ID mapping, and map_item_ids
- Add hash-based ID mapping (splitmix64) as alternative to dense
torch.unique mapping in build_sequences and align_embeddings.
- Add UniSRecModel.export_to_onnx() for native ONNX export of
encoder and item embeddings (project_all).
- Add UniSRecModel.map_item_ids() for external→internal ID conversion
at inference time (works for both dense and hash modes).
- Remove FlatSASRecModel/FlatSASRecLightning (RecTools-coupled wrappers
that duplicated UniSRecModel functionality).
- Add tests: hash mapping (including string-derived IDs),
ONNX export roundtrip, map_item_ids for both modes.1 parent 7d3850b commit f2fdfe5
11 files changed
Lines changed: 605 additions & 706 deletions
File tree
- rectools/fast_transformers
- tests/fast_transformers
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
| 3 | + | |
6 | 4 | | |
7 | 5 | | |
8 | 6 | | |
| |||
12 | 10 | | |
13 | 11 | | |
14 | 12 | | |
| 13 | + | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | 18 | | |
23 | 19 | | |
24 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
10 | 30 | | |
11 | 31 | | |
12 | 32 | | |
13 | 33 | | |
14 | 34 | | |
15 | 35 | | |
16 | 36 | | |
| 37 | + | |
17 | 38 | | |
18 | 39 | | |
19 | 40 | | |
20 | 41 | | |
21 | 42 | | |
22 | | - | |
23 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
24 | 53 | | |
25 | 54 | | |
26 | 55 | | |
| |||
74 | 103 | | |
75 | 104 | | |
76 | 105 | | |
| 106 | + | |
77 | 107 | | |
78 | 108 | | |
79 | 109 | | |
80 | 110 | | |
81 | 111 | | |
82 | 112 | | |
83 | | - | |
84 | 113 | | |
85 | 114 | | |
| 115 | + | |
| 116 | + | |
86 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
87 | 123 | | |
88 | 124 | | |
89 | 125 | | |
| |||
This file was deleted.
0 commit comments