Commit e604980
authored
fixup: check safetensors files by file extension (#13)
fixup: check weight files by file extension
We noticed that during modctl builds, some non-weight files
might be mistakenly identified as weight files (application/vnd.cnai.model.doc.v1.raw),
such as the `tiktoken.model` file in kimi k2. This could
cause these files to be excluded when `excludeWeights = true`,
affecting inference engine startup.
This PR fixes it by checking file extensions to accurately
identify weight files, preventing the above problem.
Currently, this solution applies only to .safetensors files,
if additional weight file formats are introduced in the future,
the detection logic will need to be further extended.
Signed-off-by: imeoer <[email protected]>1 parent 0658ae6 commit e604980
3 files changed
+9
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | | - | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
| |||
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | 26 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
| 27 | + | |
| 28 | + | |
42 | 29 | | |
43 | 30 | | |
44 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
45 | 34 | | |
46 | 35 | | |
| 36 | + | |
47 | 37 | | |
48 | 38 | | |
49 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | 19 | | |
24 | 20 | | |
25 | 21 | | |
| |||
0 commit comments