embed_anything 0.6.7

Embed anything at lightning speed
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
use strum::EnumString;

use super::pooling::Pooling;

use super::model_info::ModelInfo;

// use super::quantization::QuantizationMode;

use std::{collections::HashMap, fmt::Display, sync::OnceLock};

/// Lazy static list of all available models.
static MODEL_MAP: OnceLock<HashMap<ONNXModel, ModelInfo<ONNXModel>>> = OnceLock::new();

#[derive(Debug, Clone, PartialEq, Eq, Hash, EnumString, Copy)]
pub enum ONNXModel {
    /// sentence-transformers/all-MiniLM-L6-v2
    AllMiniLML6V2,
    /// Quantized sentence-transformers/all-MiniLM-L6-v2
    AllMiniLML6V2Q,
    /// sentence-transformers/all-MiniLM-L12-v2
    AllMiniLML12V2,
    /// Quantized sentence-transformers/all-MiniLM-L12-v2
    AllMiniLML12V2Q,
    /// ModernBERTBASE
    ModernBERTBase,
    /// ModernBERTLARGE
    ModernBERTLarge,
    /// BAAI/bge-base-en-v1.5
    BGEBaseENV15,
    /// Quantized BAAI/bge-base-en-v1.5
    BGEBaseENV15Q,
    /// BAAI/bge-large-en-v1.5
    BGELargeENV15,
    /// Quantized BAAI/bge-large-en-v1.5
    BGELargeENV15Q,
    /// BAAI/bge-small-en-v1.5 - Default
    BGESmallENV15,
    /// Quantized BAAI/bge-small-en-v1.5
    BGESmallENV15Q,
    /// nomic-ai/nomic-embed-text-v1
    NomicEmbedTextV1,
    /// nomic-ai/nomic-embed-text-v1.5
    NomicEmbedTextV15,
    /// Quantized v1.5 nomic-ai/nomic-embed-text-v1.5
    NomicEmbedTextV15Q,
    /// sentence-transformers/paraphrase-MiniLM-L6-v2
    ParaphraseMLMiniLML12V2,
    /// Quantized sentence-transformers/paraphrase-MiniLM-L6-v2
    ParaphraseMLMiniLML12V2Q,
    /// sentence-transformers/paraphrase-mpnet-base-v2
    ParaphraseMLMpnetBaseV2,
    /// BAAI/bge-small-zh-v1.5
    BGESmallZHV15,
    /// intfloat/multilingual-e5-small
    MultilingualE5Small,
    /// intfloat/multilingual-e5-base
    MultilingualE5Base,
    /// intfloat/multilingual-e5-large
    MultilingualE5Large,
    /// mixedbread-ai/mxbai-embed-large-v1
    MxbaiEmbedLargeV1,
    /// Quantized mixedbread-ai/mxbai-embed-large-v1
    MxbaiEmbedLargeV1Q,
    /// Alibaba-NLP/gte-base-en-v1.5
    GTEBaseENV15,
    /// Quantized Alibaba-NLP/gte-base-en-v1.5
    GTEBaseENV15Q,
    /// Alibaba-NLP/gte-large-en-v1.5
    GTELargeENV15,
    /// Quantized Alibaba-NLP/gte-large-en-v1.5
    GTELargeENV15Q,
    /// jinaai/jina-embeddings-v2-small-en
    JINAV2SMALLEN,
    /// jinaai/jina-embeddings-v2-base-en
    JINAV2BASEEN,
    /// jinaai/jina-embeddings-v3
    JINAV3,
    /// prithivida/Splade_PP_en_v1
    SPLADEPPENV1,
    /// prithivida/Splade_PP_en_v2
    SPLADEPPENV2,
    /// onnx-models/jina-colbert-v1-en-onnx
    JinaColBERTv1,
    /// Qwen/Qwen3-Embedding-0.6B
    Qwen3Embedding06B,
}

/// Centralized function to initialize the models map.
fn init_models_map() -> HashMap<ONNXModel, ModelInfo<ONNXModel>> {
    let models_list = vec![
        ModelInfo {
            model: ONNXModel::AllMiniLML6V2,
            dim: 384,
            description: String::from("Sentence Transformer model, MiniLM-L6-v2"),
            hf_model_id: String::from("sentence-transformers/all-MiniLM-L6-v2"),
            model_code: String::from("Qdrant/all-MiniLM-L6-v2-onnx"),
            model_file: String::from("model.onnx"),
        },
        ModelInfo {
            model: ONNXModel::AllMiniLML6V2Q,
            dim: 384,
            description: String::from("Quantized Sentence Transformer model, MiniLM-L6-v2"),
            hf_model_id: String::from("Xenova/all-MiniLM-L6-v2"),
            model_code: String::from("Xenova/all-MiniLM-L6-v2"),
            model_file: String::from("onnx/model_quantized.onnx"),
        },
        ModelInfo {
            model: ONNXModel::AllMiniLML12V2,
            dim: 384,
            description: String::from("Sentence Transformer model, MiniLM-L12-v2"),
            hf_model_id: String::from("sentence-transformers/all-MiniLM-L12-v2"),
            model_code: String::from("Xenova/all-MiniLM-L12-v2"),
            model_file: String::from("onnx/model.onnx"),
        },
        ModelInfo {
            model: ONNXModel::AllMiniLML12V2Q,
            dim: 384,
            description: String::from("Quantized Sentence Transformer model, MiniLM-L12-v2"),
            hf_model_id: String::from("Xenova/all-MiniLM-L12-v2"),
            model_code: String::from("Xenova/all-MiniLM-L12-v2"),
            model_file: String::from("onnx/model_quantized.onnx"),
        },
        ModelInfo {
            model: ONNXModel::ModernBERTBase,
            dim: 768,
            description: String::from("Modern BERT model"),
            hf_model_id: String::from("nomic-ai/modernbert-embed-base"),
            model_code: String::from("nomic-ai/modernbert-embed-base"),
            model_file: String::from("onnx/model.onnx"),
        },
        ModelInfo {
            model: ONNXModel::ModernBERTLarge,
            dim: 1024,
            description: String::from("Modern BERT model"),
            hf_model_id: String::from("answerdotai/ModernBERT-large"),
            model_code: String::from("answerdotai/ModernBERT-large"),
            model_file: String::from("onnx/model.onnx"),
        },
        ModelInfo {
            model: ONNXModel::BGEBaseENV15,
            dim: 768,
            description: String::from("v1.5 release of the base English model"),
            hf_model_id: String::from("BAAI/bge-base-en-v1.5"),
            model_code: String::from("Xenova/bge-base-en-v1.5"),
            model_file: String::from("onnx/model.onnx"),
        },
        ModelInfo {
            model: ONNXModel::BGEBaseENV15Q,
            dim: 768,
            description: String::from("Quantized v1.5 release of the large English model"),
            hf_model_id: String::from("Qdrant/bge-base-en-v1.5-onnx-Q"),
            model_code: String::from("Qdrant/bge-base-en-v1.5-onnx-Q"),
            model_file: String::from("model_optimized.onnx"),
        },
        ModelInfo {
            model: ONNXModel::BGELargeENV15,
            dim: 1024,
            description: String::from("v1.5 release of the large English model"),
            hf_model_id: String::from("BAAI/bge-large-en-v1.5"),
            model_code: String::from("Xenova/bge-large-en-v1.5"),
            model_file: String::from("onnx/model.onnx"),
        },
        ModelInfo {
            model: ONNXModel::BGELargeENV15Q,
            dim: 1024,
            description: String::from("Quantized v1.5 release of the large English model"),
            hf_model_id: String::from("Qdrant/bge-large-en-v1.5-onnx-Q"),
            model_code: String::from("Qdrant/bge-large-en-v1.5-onnx-Q"),
            model_file: String::from("model_optimized.onnx"),
        },
        ModelInfo {
            model: ONNXModel::BGESmallENV15,
            dim: 384,
            description: String::from("v1.5 release of the fast and default English model"),
            hf_model_id: String::from("BAAI/bge-small-en-v1.5"),
            model_code: String::from("Xenova/bge-small-en-v1.5"),
            model_file: String::from("onnx/model.onnx"),
        },
        ModelInfo {
            model: ONNXModel::BGESmallENV15Q,
            dim: 384,
            description: String::from(
                "Quantized v1.5 release of the fast and default English model",
            ),
            hf_model_id: String::from("Qdrant/bge-small-en-v1.5-onnx-Q"),
            model_code: String::from("Qdrant/bge-small-en-v1.5-onnx-Q"),
            model_file: String::from("model_optimized.onnx"),
        },
        ModelInfo {
            model: ONNXModel::NomicEmbedTextV1,
            dim: 768,
            description: String::from("8192 context length english model"),
            hf_model_id: String::from("nomic-ai/nomic-embed-text-v1"),
            model_code: String::from("nomic-ai/nomic-embed-text-v1"),
            model_file: String::from("onnx/model.onnx"),
        },
        ModelInfo {
            model: ONNXModel::NomicEmbedTextV15,
            dim: 768,
            description: String::from("v1.5 release of the 8192 context length english model"),
            hf_model_id: String::from("nomic-ai/nomic-embed-text-v1.5"),
            model_code: String::from("nomic-ai/nomic-embed-text-v1.5"),
            model_file: String::from("onnx/model.onnx"),
        },
        ModelInfo {
            model: ONNXModel::NomicEmbedTextV15Q,
            dim: 768,
            description: String::from(
                "Quantized v1.5 release of the 8192 context length english model",
            ),
            hf_model_id: String::from("Qdrant/nomic-embed-text-v1.5-onnx-Q"),
            model_code: String::from("Qdrant/nomic-embed-text-v1.5-onnx-Q"),
            model_file: String::from("onnx/model_quantized.onnx"),
        },
        ModelInfo {
            model: ONNXModel::ParaphraseMLMiniLML12V2Q,
            dim: 384,
            description: String::from("Quantized Multi-lingual model"),
            hf_model_id: String::from("Qdrant/paraphrase-multilingual-MiniLM-L12-v2-onnx-Q"),
            model_code: String::from("Qdrant/paraphrase-multilingual-MiniLM-L12-v2-onnx-Q"),
            model_file: String::from("model_optimized.onnx"),
        },
        ModelInfo {
            model: ONNXModel::ParaphraseMLMiniLML12V2,
            dim: 384,
            description: String::from("Multi-lingual model"),
            hf_model_id: String::from("sentence-transformers/paraphrase-MiniLM-L6-v2"),
            model_code: String::from("Xenova/paraphrase-multilingual-MiniLM-L12-v2"),
            model_file: String::from("onnx/model.onnx"),
        },
        ModelInfo {
            model: ONNXModel::ParaphraseMLMpnetBaseV2,
            dim: 768,
            description: String::from(
                "Sentence-transformers model for tasks like clustering or semantic search",
            ),
            hf_model_id: String::from(
                "sentence-transformers/paraphrase-multilingual-mpnet-base-v2",
            ),
            model_code: String::from("Xenova/paraphrase-multilingual-mpnet-base-v2"),
            model_file: String::from("onnx/model.onnx"),
        },
        ModelInfo {
            model: ONNXModel::BGESmallZHV15,
            dim: 512,
            description: String::from("v1.5 release of the small Chinese model"),
            hf_model_id: String::from("BAAI/bge-small-zh-v1.5"),
            model_code: String::from("Xenova/bge-small-zh-v1.5"),
            model_file: String::from("onnx/model.onnx"),
        },
        ModelInfo {
            model: ONNXModel::MultilingualE5Small,
            dim: 384,
            description: String::from("Small model of multilingual E5 Text Embeddings"),
            hf_model_id: String::from("intfloat/multilingual-e5-small"),
            model_code: String::from("intfloat/multilingual-e5-small"),
            model_file: String::from("onnx/model.onnx"),
        },
        ModelInfo {
            model: ONNXModel::MultilingualE5Base,
            dim: 768,
            description: String::from("Base model of multilingual E5 Text Embeddings"),
            hf_model_id: String::from("intfloat/multilingual-e5-base"),
            model_code: String::from("intfloat/multilingual-e5-base"),
            model_file: String::from("onnx/model.onnx"),
        },
        ModelInfo {
            model: ONNXModel::MultilingualE5Large,
            dim: 1024,
            description: String::from("Large model of multilingual E5 Text Embeddings"),
            hf_model_id: String::from("intfloat/multilingual-e5-large"),
            model_code: String::from("Qdrant/multilingual-e5-large-onnx"),
            model_file: String::from("model.onnx"),
        },
        ModelInfo {
            model: ONNXModel::MxbaiEmbedLargeV1,
            dim: 1024,
            description: String::from("Large English embedding model from MixedBreed.ai"),
            hf_model_id: String::from("mixedbread-ai/mxbai-embed-large-v1"),
            model_code: String::from("mixedbread-ai/mxbai-embed-large-v1"),
            model_file: String::from("onnx/model.onnx"),
        },
        ModelInfo {
            model: ONNXModel::MxbaiEmbedLargeV1Q,
            dim: 1024,
            description: String::from("Quantized Large English embedding model from MixedBreed.ai"),
            hf_model_id: String::from("mixedbread-ai/mxbai-embed-large-v1"),
            model_code: String::from("mixedbread-ai/mxbai-embed-large-v1"),
            model_file: String::from("onnx/model_quantized.onnx"),
        },
        ModelInfo {
            model: ONNXModel::GTEBaseENV15,
            dim: 768,
            description: String::from("Large multilingual embedding model from Alibaba"),
            hf_model_id: String::from("Alibaba-NLP/gte-base-en-v1.5"),
            model_code: String::from("Alibaba-NLP/gte-base-en-v1.5"),
            model_file: String::from("onnx/model.onnx"),
        },
        ModelInfo {
            model: ONNXModel::GTEBaseENV15Q,
            dim: 768,
            description: String::from("Quantized Large multilingual embedding model from Alibaba"),
            hf_model_id: String::from("Alibaba-NLP/gte-base-en-v1.5"),
            model_code: String::from("Alibaba-NLP/gte-base-en-v1.5"),
            model_file: String::from("onnx/model_quantized.onnx"),
        },
        ModelInfo {
            model: ONNXModel::GTELargeENV15,
            dim: 1024,
            description: String::from("Large multilingual embedding model from Alibaba"),
            hf_model_id: String::from("Alibaba-NLP/gte-large-en-v1.5"),
            model_code: String::from("Alibaba-NLP/gte-large-en-v1.5"),
            model_file: String::from("onnx/model.onnx"),
        },
        ModelInfo {
            model: ONNXModel::GTELargeENV15Q,
            dim: 1024,
            description: String::from("Quantized Large multilingual embedding model from Alibaba"),
            hf_model_id: String::from("Alibaba-NLP/gte-large-en-v1.5"),
            model_code: String::from("Alibaba-NLP/gte-large-en-v1.5"),
            model_file: String::from("onnx/model_quantized.onnx"),
        },
        ModelInfo {
            model: ONNXModel::JINAV2SMALLEN,
            dim: 512,
            description: String::from("Small model of multilingual jina embeddings"),
            hf_model_id: String::from("jinaai/jina-embeddings-v2-small-en"),
            model_code: String::from("jinaai/jina-embeddings-v2-small-en"),
            model_file: String::from("model.onnx"),
        },
        ModelInfo {
            model: ONNXModel::JINAV2BASEEN,
            dim: 768,
            description: String::from("Base model of multilingual jina embeddings"),
            hf_model_id: String::from("jinaai/jina-embeddings-v2-base-en"),
            model_code: String::from("jinaai/jina-embeddings-v2-base-en"),
            model_file: String::from("model.onnx"),
        },
        ModelInfo {
            model: ONNXModel::JINAV3,
            dim: 768,
            description: String::from("Base model of multilingual jina embeddings"),
            hf_model_id: String::from("jinaai/jina-embeddings-v3"),
            model_code: String::from("jinaai/jina-embeddings-v3"),
            model_file: String::from("onnx/model.onnx"),
        },
        ModelInfo {
            model: ONNXModel::SPLADEPPENV1,
            dim: 768,
            description: String::from("Sparse BERT model"),
            hf_model_id: String::from("prithivida/Splade_PP_en_v1"),
            model_code: String::from("prithivida/Splade_PP_en_v1"),
            model_file: String::from("onnx/model.onnx"),
        },
        ModelInfo {
            model: ONNXModel::SPLADEPPENV2,
            dim: 768,
            description: String::from("Sparse BERT model"),
            hf_model_id: String::from("prithivida/Splade_PP_en_v2"),
            model_code: String::from("prithivida/Splade_PP_en_v2"),
            model_file: String::from("onnx/model.onnx"),
        },
        ModelInfo {
            model: ONNXModel::JinaColBERTv1,
            dim: 384,
            description: String::from("Jina ColBERT v1"),
            hf_model_id: String::from("jinaai/jina-embeddings-v2-small-en"),
            model_code: String::from("onnx-models/jina-colbert-v1-en-onnx"),
            model_file: String::from("model.onnx"),
        },
        ModelInfo {
            model: ONNXModel::Qwen3Embedding06B,
            dim: 768,
            description: String::from("Qwen3 Embedding 0.6B"),
            hf_model_id: String::from("onnx-community/Qwen3-Embedding-0.6B-ONNX"),
            model_code: String::from("onnx-community/Qwen3-Embedding-0.6B-ONNX"),
            model_file: String::from("onnx/model.onnx"),
        },
    ];

    // TODO: Use when out in stable
    // assert_eq!(
    //     std::mem::variant_count::<ONNXModel>(),
    //     models_list.len(),
    //     "models::models() is not exhaustive"
    // );

    models_list
        .into_iter()
        .fold(HashMap::new(), |mut map, model| {
            // Insert the model into the map
            map.insert(model.model, model);
            map
        })
}

/// Get a map of all available models.
pub fn models_map() -> &'static HashMap<ONNXModel, ModelInfo<ONNXModel>> {
    MODEL_MAP.get_or_init(init_models_map)
}

/// Get model information by model code.
pub fn get_model_info(model: &ONNXModel) -> Option<&ModelInfo<ONNXModel>> {
    models_map().get(model)
}

pub fn get_model_info_by_hf_id(hf_model_id: &str) -> Option<&ModelInfo<ONNXModel>> {
    models_map()
        .values()
        .find(|model| model.hf_model_id == hf_model_id)
}

/// Get a list of all available models.
///
/// This will assign new memory to the models list; where possible, use
/// [`models_map`] instead.
pub fn models_list() -> Vec<ModelInfo<ONNXModel>> {
    models_map().values().cloned().collect()
}

impl ONNXModel {
    pub fn get_default_pooling_method(&self) -> Option<Pooling> {
        match self {
            ONNXModel::AllMiniLML6V2 => Some(Pooling::Mean),
            ONNXModel::AllMiniLML6V2Q => Some(Pooling::Mean),
            ONNXModel::AllMiniLML12V2 => Some(Pooling::Mean),
            ONNXModel::AllMiniLML12V2Q => Some(Pooling::Mean),
            ONNXModel::ModernBERTBase => Some(Pooling::Mean),
            ONNXModel::ModernBERTLarge => Some(Pooling::Mean),

            ONNXModel::BGEBaseENV15 => Some(Pooling::Cls),
            ONNXModel::BGEBaseENV15Q => Some(Pooling::Cls),
            ONNXModel::BGELargeENV15 => Some(Pooling::Cls),
            ONNXModel::BGELargeENV15Q => Some(Pooling::Cls),
            ONNXModel::BGESmallENV15 => Some(Pooling::Cls),
            ONNXModel::BGESmallENV15Q => Some(Pooling::Cls),
            ONNXModel::BGESmallZHV15 => Some(Pooling::Cls),

            ONNXModel::NomicEmbedTextV1 => Some(Pooling::Mean),
            ONNXModel::NomicEmbedTextV15 => Some(Pooling::Mean),
            ONNXModel::NomicEmbedTextV15Q => Some(Pooling::Mean),

            ONNXModel::ParaphraseMLMiniLML12V2 => Some(Pooling::Mean),
            ONNXModel::ParaphraseMLMiniLML12V2Q => Some(Pooling::Mean),
            ONNXModel::ParaphraseMLMpnetBaseV2 => Some(Pooling::Mean),

            ONNXModel::MultilingualE5Base => Some(Pooling::Mean),
            ONNXModel::MultilingualE5Small => Some(Pooling::Mean),
            ONNXModel::MultilingualE5Large => Some(Pooling::Mean),

            ONNXModel::MxbaiEmbedLargeV1 => Some(Pooling::Cls),
            ONNXModel::MxbaiEmbedLargeV1Q => Some(Pooling::Cls),

            ONNXModel::GTEBaseENV15 => Some(Pooling::Cls),
            ONNXModel::GTEBaseENV15Q => Some(Pooling::Cls),
            ONNXModel::GTELargeENV15 => Some(Pooling::Cls),
            ONNXModel::GTELargeENV15Q => Some(Pooling::Cls),

            ONNXModel::JINAV2SMALLEN => Some(Pooling::Mean),
            ONNXModel::JINAV2BASEEN => Some(Pooling::Mean),
            ONNXModel::JINAV3 => Some(Pooling::Mean),
            ONNXModel::SPLADEPPENV1 => Some(Pooling::Mean),
            ONNXModel::SPLADEPPENV2 => Some(Pooling::Mean),
            ONNXModel::JinaColBERTv1 => None,
            ONNXModel::Qwen3Embedding06B => Some(Pooling::LastToken),
        }
    }

    /// Get the quantization mode of the model.
    ///
    /// Any models with a `Q` suffix in their name are quantized models.
    ///
    /// Currently only 6 supported models have dynamic quantization:
    /// - Alibaba-NLP/gte-base-en-v1.5
    /// - Alibaba-NLP/gte-large-en-v1.5
    /// - mixedbread-ai/mxbai-embed-large-v1
    /// - nomic-ai/nomic-embed-text-v1.5
    /// - Xenova/all-MiniLM-L12-v2
    /// - Xenova/all-MiniLM-L6-v2
    ///
    // TODO: Update this list when more models are added
    pub fn get_quantization_mode(&self) -> Result<(), anyhow::Error> {
        // match self {
        //     ONNXModel::AllMiniLML6V2Q => QuantizationMode::Dynamic,
        //     ONNXModel::AllMiniLML12V2Q => QuantizationMode::Dynamic,
        //     ONNXModel::BGEBaseENV15Q => QuantizationMode::Static,
        //     ONNXModel::BGELargeENV15Q => QuantizationMode::Static,
        //     ONNXModel::BGESmallENV15Q => QuantizationMode::Static,
        //     ONNXModel::NomicEmbedTextV15Q => QuantizationMode::Dynamic,
        //     ONNXModel::ParaphraseMLMiniLML12V2Q => QuantizationMode::Static,
        //     ONNXModel::MxbaiEmbedLargeV1Q => QuantizationMode::Dynamic,
        //     ONNXModel::GTEBaseENV15Q => QuantizationMode::Dynamic,
        //     ONNXModel::GTELargeENV15Q => QuantizationMode::Dynamic,
        //     _ => QuantizationMode::None,
        // }
        unimplemented!()
    }
}

impl Display for ONNXModel {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        let model_info = get_model_info(self).expect("Model not found.");
        write!(f, "{}", model_info.model_code)
    }
}