-
Notifications
You must be signed in to change notification settings - Fork 528
/
Copy path__init__.py
88 lines (78 loc) · 3.03 KB
/
__init__.py
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
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
# Copyright 2024 Arm Limited and/or its affiliates.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
from enum import Enum
class Model(str, Enum):
Mul = "mul"
Linear = "linear"
Add = "add"
AddMul = "add_mul"
Softmax = "softmax"
Dl3 = "dl3"
Edsr = "edsr"
EmformerTranscribe = "emformer_transcribe"
EmformerPredict = "emformer_predict"
EmformerJoin = "emformer_join"
Llama2 = "llama2"
Llama = "llama"
Llama32VisionEncoder = "llama3_2_vision_encoder"
Lstm = "lstm"
MobileBert = "mobilebert"
Mv2 = "mv2"
Mv2Untrained = "mv2_untrained"
Mv3 = "mv3"
Vit = "vit"
W2l = "w2l"
Ic3 = "ic3"
Ic4 = "ic4"
ResNet18 = "resnet18"
ResNet50 = "resnet50"
Llava = "llava"
EfficientSam = "efficient_sam"
Qwen25 = "qwen2_5"
Phi4Mini = "phi_4_mini"
def __str__(self) -> str:
return self.value
class Backend(str, Enum):
XnnpackQuantizationDelegation = "xnnpack-quantization-delegation"
CoreMlTest = "coreml-test"
def __str__(self) -> str:
return self.value
MODEL_NAME_TO_MODEL = {
str(Model.Mul): ("toy_model", "MulModule"),
str(Model.Linear): ("toy_model", "LinearModule"),
str(Model.Add): ("toy_model", "AddModule"),
str(Model.AddMul): ("toy_model", "AddMulModule"),
str(Model.Softmax): ("toy_model", "SoftmaxModule"),
str(Model.Dl3): ("deeplab_v3", "DeepLabV3ResNet50Model"),
str(Model.Edsr): ("edsr", "EdsrModel"),
str(Model.EmformerTranscribe): ("emformer_rnnt", "EmformerRnntTranscriberModel"),
str(Model.EmformerPredict): ("emformer_rnnt", "EmformerRnntPredictorModel"),
str(Model.EmformerJoin): ("emformer_rnnt", "EmformerRnntJoinerModel"),
str(Model.Llama2): ("llama", "Llama2Model"),
str(Model.Llama): ("llama", "Llama2Model"),
str(Model.Llama32VisionEncoder): ("llama3_2_vision", "FlamingoVisionEncoderModel"),
# TODO: This take too long to export on both Linux and MacOS (> 6 hours)
# "llama3_2_text_decoder": ("llama3_2_vision", "Llama3_2Decoder"),
str(Model.Lstm): ("lstm", "LSTMModel"),
str(Model.MobileBert): ("mobilebert", "MobileBertModelExample"),
str(Model.Mv2): ("mobilenet_v2", "MV2Model"),
str(Model.Mv2Untrained): ("mobilenet_v2", "MV2UntrainedModel"),
str(Model.Mv3): ("mobilenet_v3", "MV3Model"),
str(Model.Vit): ("torchvision_vit", "TorchVisionViTModel"),
str(Model.W2l): ("wav2letter", "Wav2LetterModel"),
str(Model.Ic3): ("inception_v3", "InceptionV3Model"),
str(Model.Ic4): ("inception_v4", "InceptionV4Model"),
str(Model.ResNet18): ("resnet", "ResNet18Model"),
str(Model.ResNet50): ("resnet", "ResNet50Model"),
str(Model.Llava): ("llava", "LlavaModel"),
str(Model.EfficientSam): ("efficient_sam", "EfficientSAM"),
str(Model.Qwen25): ("qwen2_5", "Qwen2_5Model"),
str(Model.Phi4Mini): ("phi_4_mini", "Phi4MiniModel"),
}
__all__ = [
"MODEL_NAME_TO_MODEL",
]