Skip to content

Commit 5953053

Browse files
recipe(multilingual-e5-small): add CPU fp32/fp16 feature-extraction and sentence-similarity recipes
intfloat/multilingual-e5-small is a BertModel sentence embedder. The default build fails at quantize (calibration reader omits token_type_ids); these quant:null float recipes skip that step and build a working float model. L2 PyTorch-vs-ONNX embedding cosine 1.000000, retrieval ranking preserved. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent d9feeff commit 5953053

4 files changed

Lines changed: 264 additions & 0 deletions

File tree

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"export": {
3+
"opset_version": 17,
4+
"batch_size": 1,
5+
"export_params": true,
6+
"do_constant_folding": true,
7+
"verbose": false,
8+
"dynamo": false,
9+
"enable_hierarchy_tags": true,
10+
"clean_onnx": false,
11+
"hierarchy_tag_format": "full",
12+
"input_tensors": [
13+
{
14+
"name": "input_ids",
15+
"dtype": "int32",
16+
"shape": [
17+
1,
18+
512
19+
],
20+
"value_range": [
21+
0,
22+
250037
23+
]
24+
},
25+
{
26+
"name": "attention_mask",
27+
"dtype": "int32",
28+
"shape": [
29+
1,
30+
512
31+
],
32+
"value_range": [
33+
0,
34+
2
35+
]
36+
},
37+
{
38+
"name": "token_type_ids",
39+
"dtype": "int32",
40+
"shape": [
41+
1,
42+
512
43+
],
44+
"value_range": [
45+
0,
46+
2
47+
]
48+
}
49+
],
50+
"output_tensors": [
51+
{
52+
"name": "last_hidden_state"
53+
}
54+
]
55+
},
56+
"optim": {
57+
"clamp_constant_values": true
58+
},
59+
"quant": null,
60+
"compile": null,
61+
"loader": {
62+
"task": "feature-extraction",
63+
"model_class": "AutoModel",
64+
"model_type": "bert"
65+
}
66+
}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"export": {
3+
"opset_version": 17,
4+
"batch_size": 1,
5+
"export_params": true,
6+
"do_constant_folding": true,
7+
"verbose": false,
8+
"dynamo": false,
9+
"enable_hierarchy_tags": true,
10+
"clean_onnx": false,
11+
"hierarchy_tag_format": "full",
12+
"input_tensors": [
13+
{
14+
"name": "input_ids",
15+
"dtype": "int32",
16+
"shape": [
17+
1,
18+
512
19+
],
20+
"value_range": [
21+
0,
22+
250037
23+
]
24+
},
25+
{
26+
"name": "attention_mask",
27+
"dtype": "int32",
28+
"shape": [
29+
1,
30+
512
31+
],
32+
"value_range": [
33+
0,
34+
2
35+
]
36+
},
37+
{
38+
"name": "token_type_ids",
39+
"dtype": "int32",
40+
"shape": [
41+
1,
42+
512
43+
],
44+
"value_range": [
45+
0,
46+
2
47+
]
48+
}
49+
],
50+
"output_tensors": [
51+
{
52+
"name": "last_hidden_state"
53+
}
54+
]
55+
},
56+
"optim": {
57+
"clamp_constant_values": true
58+
},
59+
"quant": null,
60+
"compile": null,
61+
"loader": {
62+
"task": "feature-extraction",
63+
"model_class": "AutoModel",
64+
"model_type": "bert"
65+
}
66+
}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"export": {
3+
"opset_version": 17,
4+
"batch_size": 1,
5+
"export_params": true,
6+
"do_constant_folding": true,
7+
"verbose": false,
8+
"dynamo": false,
9+
"enable_hierarchy_tags": true,
10+
"clean_onnx": false,
11+
"hierarchy_tag_format": "full",
12+
"input_tensors": [
13+
{
14+
"name": "input_ids",
15+
"dtype": "int32",
16+
"shape": [
17+
1,
18+
512
19+
],
20+
"value_range": [
21+
0,
22+
250037
23+
]
24+
},
25+
{
26+
"name": "attention_mask",
27+
"dtype": "int32",
28+
"shape": [
29+
1,
30+
512
31+
],
32+
"value_range": [
33+
0,
34+
2
35+
]
36+
},
37+
{
38+
"name": "token_type_ids",
39+
"dtype": "int32",
40+
"shape": [
41+
1,
42+
512
43+
],
44+
"value_range": [
45+
0,
46+
2
47+
]
48+
}
49+
],
50+
"output_tensors": [
51+
{
52+
"name": "last_hidden_state"
53+
}
54+
]
55+
},
56+
"optim": {
57+
"clamp_constant_values": true
58+
},
59+
"quant": null,
60+
"compile": null,
61+
"loader": {
62+
"task": "sentence-similarity",
63+
"model_class": "AutoModel",
64+
"model_type": "bert"
65+
}
66+
}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"export": {
3+
"opset_version": 17,
4+
"batch_size": 1,
5+
"export_params": true,
6+
"do_constant_folding": true,
7+
"verbose": false,
8+
"dynamo": false,
9+
"enable_hierarchy_tags": true,
10+
"clean_onnx": false,
11+
"hierarchy_tag_format": "full",
12+
"input_tensors": [
13+
{
14+
"name": "input_ids",
15+
"dtype": "int32",
16+
"shape": [
17+
1,
18+
512
19+
],
20+
"value_range": [
21+
0,
22+
250037
23+
]
24+
},
25+
{
26+
"name": "attention_mask",
27+
"dtype": "int32",
28+
"shape": [
29+
1,
30+
512
31+
],
32+
"value_range": [
33+
0,
34+
2
35+
]
36+
},
37+
{
38+
"name": "token_type_ids",
39+
"dtype": "int32",
40+
"shape": [
41+
1,
42+
512
43+
],
44+
"value_range": [
45+
0,
46+
2
47+
]
48+
}
49+
],
50+
"output_tensors": [
51+
{
52+
"name": "last_hidden_state"
53+
}
54+
]
55+
},
56+
"optim": {
57+
"clamp_constant_values": true
58+
},
59+
"quant": null,
60+
"compile": null,
61+
"loader": {
62+
"task": "sentence-similarity",
63+
"model_class": "AutoModel",
64+
"model_type": "bert"
65+
}
66+
}

0 commit comments

Comments
 (0)