JustJaro commited on
Commit
1d643b7
·
verified ·
1 Parent(s): bd9d699

Upload ONNX model with opset 19

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: multilingual
3
+ license: mit
4
+ tags:
5
+ - onnx
6
+ - optimum
7
+ - text-embedding
8
+ - onnxruntime
9
+ - opset19
10
+ - sentence-similarity
11
+ - gpu
12
+ - optimized
13
+ datasets:
14
+ - mmarco
15
+ pipeline_tag: sentence-similarity
16
+ ---
17
+
18
+ # gte-multilingual-reranker-base-onnx-op19-opt-gpu
19
+
20
+ This model is an ONNX version of [Alibaba-NLP/gte-multilingual-reranker-base](https://huggingface.co/Alibaba-NLP/gte-multilingual-reranker-base) using ONNX opset 19.
21
+
22
+ ## Model Details
23
+
24
+ - **Framework**: ONNX Runtime
25
+ - **ONNX Opset**: 19
26
+ - **Task**: sentence-similarity
27
+ - **Target Device**: GPU
28
+ - **Optimized**: Yes
29
+ - **Original Model**: [Alibaba-NLP/gte-multilingual-reranker-base](https://huggingface.co/Alibaba-NLP/gte-multilingual-reranker-base)
30
+ - **Exported On**: 2025-03-31
31
+
32
+ ## Environment and Package Versions
33
+
34
+ | Package | Version |
35
+ | --- | --- |
36
+ | transformers | 4.48.3 |
37
+ | optimum | 1.24.0 |
38
+ | onnx | 1.17.0 |
39
+ | onnxruntime | 1.21.0 |
40
+ | torch | 2.5.1 |
41
+ | numpy | 1.26.4 |
42
+ | huggingface_hub | 0.28.1 |
43
+ | python | 3.12.9 |
44
+ | system | Darwin 24.3.0 |
45
+
46
+
47
+ ### Applied Optimizations
48
+
49
+ | Optimization | Setting |
50
+ | --- | --- |
51
+ | Graph Optimization Level | Extended |
52
+ | Optimize for GPU | Yes |
53
+ | Use FP16 | No |
54
+ | Transformers Specific Optimizations Enabled | Yes |
55
+ | Gelu Fusion Enabled | Yes |
56
+ | Layer Norm Fusion Enabled | Yes |
57
+ | Attention Fusion Enabled | Yes |
58
+ | Skip Layer Norm Fusion Enabled | Yes |
59
+ | Gelu Approximation Enabled | Yes |
60
+
61
+
62
+ ## Usage
63
+
64
+ ```python
65
+ from optimum.onnxruntime import ORTModelForSequenceClassification
66
+ from transformers import AutoTokenizer
67
+
68
+ # Load model and tokenizer
69
+ model = ORTModelForSequenceClassification.from_pretrained("onnx")
70
+ tokenizer = AutoTokenizer.from_pretrained("onnx")
71
+
72
+ # Prepare input
73
+ text = "Your text here"
74
+ inputs = tokenizer(text, return_tensors="pt")
75
+
76
+ # Run inference
77
+ outputs = model(**inputs)
78
+ ```
79
+
80
+ ## Export Process
81
+
82
+ This model was exported to ONNX format using the Optimum library from Hugging Face with opset 19.
83
+ Graph optimization was applied during export, targeting GPU devices.
84
+
85
+ ## Performance
86
+
87
+ ONNX Runtime models generally offer better inference speed compared to native PyTorch models,
88
+ especially when deployed to production environments.
config.json ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "Alibaba-NLP/gte-multilingual-reranker-base",
3
+ "architectures": [
4
+ "NewForSequenceClassification"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.0,
7
+ "auto_map": {
8
+ "AutoConfig": "Alibaba-NLP/new-impl--configuration.NewConfig",
9
+ "AutoModel": "Alibaba-NLP/new-impl--modeling.NewModel",
10
+ "AutoModelForMaskedLM": "Alibaba-NLP/new-impl--modeling.NewForMaskedLM",
11
+ "AutoModelForMultipleChoice": "Alibaba-NLP/new-impl--modeling.NewForMultipleChoice",
12
+ "AutoModelForQuestionAnswering": "Alibaba-NLP/new-impl--modeling.NewForQuestionAnswering",
13
+ "AutoModelForSequenceClassification": "Alibaba-NLP/new-impl--modeling.NewForSequenceClassification",
14
+ "AutoModelForTokenClassification": "Alibaba-NLP/new-impl--modeling.NewForTokenClassification"
15
+ },
16
+ "classifier_dropout": 0.0,
17
+ "hidden_act": "gelu",
18
+ "hidden_dropout_prob": 0.1,
19
+ "hidden_size": 768,
20
+ "id2label": {
21
+ "0": "LABEL_0"
22
+ },
23
+ "initializer_range": 0.02,
24
+ "intermediate_size": 3072,
25
+ "label2id": {
26
+ "LABEL_0": 0
27
+ },
28
+ "layer_norm_eps": 1e-12,
29
+ "layer_norm_type": "layer_norm",
30
+ "logn_attention_clip1": false,
31
+ "logn_attention_scale": false,
32
+ "max_position_embeddings": 8192,
33
+ "model_type": "new",
34
+ "num_attention_heads": 12,
35
+ "num_hidden_layers": 12,
36
+ "pack_qkv": true,
37
+ "pad_token_id": 1,
38
+ "position_embedding_type": "rope",
39
+ "rope_scaling": {
40
+ "factor": 8.0,
41
+ "type": "ntk"
42
+ },
43
+ "rope_theta": 20000,
44
+ "torch_dtype": "float32",
45
+ "transformers_version": "4.48.3",
46
+ "type_vocab_size": 1,
47
+ "unpad_inputs": false,
48
+ "use_memory_efficient_attention": false,
49
+ "vocab_size": 250048
50
+ }
model.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:674ae753bf4d9f266b3ff83a68e6cfb3aea969d1bc79cba078d068bd4c75654e
3
+ size 1257788813
optimization_report.json ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "successful_optimizations": {
3
+ "optimization_level": 2,
4
+ "optimize_for_gpu": true,
5
+ "fp16": false,
6
+ "enable_transformers_specific_optimizations": true,
7
+ "gelu_fusion_enabled": true,
8
+ "layer_norm_fusion_enabled": true,
9
+ "attention_fusion_enabled": true,
10
+ "skip_layer_norm_fusion_enabled": true,
11
+ "gelu_approximation_enabled": true
12
+ },
13
+ "failed_optimizations": {},
14
+ "model_name": "Alibaba-NLP/gte-multilingual-reranker-base",
15
+ "task": "sentence-similarity",
16
+ "target_device": "GPU",
17
+ "timestamp": "2025-03-31T13:12:13.084323"
18
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<s>",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "cls_token": {
10
+ "content": "<s>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "eos_token": {
17
+ "content": "</s>",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "mask_token": {
24
+ "content": "<mask>",
25
+ "lstrip": true,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ },
30
+ "pad_token": {
31
+ "content": "<pad>",
32
+ "lstrip": false,
33
+ "normalized": false,
34
+ "rstrip": false,
35
+ "single_word": false
36
+ },
37
+ "sep_token": {
38
+ "content": "</s>",
39
+ "lstrip": false,
40
+ "normalized": false,
41
+ "rstrip": false,
42
+ "single_word": false
43
+ },
44
+ "unk_token": {
45
+ "content": "<unk>",
46
+ "lstrip": false,
47
+ "normalized": false,
48
+ "rstrip": false,
49
+ "single_word": false
50
+ }
51
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3a56def25aa40facc030ea8b0b87f3688e4b3c39eb8b45d5702b3a1300fe2a20
3
+ size 17082734
tokenizer_config.json ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "<s>",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "1": {
12
+ "content": "<pad>",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "2": {
20
+ "content": "</s>",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "3": {
28
+ "content": "<unk>",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "250001": {
36
+ "content": "<mask>",
37
+ "lstrip": true,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "bos_token": "<s>",
45
+ "clean_up_tokenization_spaces": true,
46
+ "cls_token": "<s>",
47
+ "eos_token": "</s>",
48
+ "extra_special_tokens": {},
49
+ "mask_token": "<mask>",
50
+ "max_length": 512,
51
+ "model_max_length": 32768,
52
+ "pad_to_multiple_of": null,
53
+ "pad_token": "<pad>",
54
+ "pad_token_type_id": 0,
55
+ "padding_side": "right",
56
+ "sep_token": "</s>",
57
+ "stride": 0,
58
+ "tokenizer_class": "XLMRobertaTokenizer",
59
+ "truncation_side": "right",
60
+ "truncation_strategy": "longest_first",
61
+ "unk_token": "<unk>"
62
+ }
upload_info.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "hf_repo": "JustJaro/gte-multilingual-reranker-base-onnx-op14-opt-gpu",
3
+ "upload_date": "2025-03-27T17:40:50.247074",
4
+ "upload_success": true,
5
+ "model_url": "https://huggingface.co/JustJaro/gte-multilingual-reranker-base-onnx-op14-opt-gpu"
6
+ }