-
Notifications
You must be signed in to change notification settings - Fork 0
/
__init__.py
70 lines (42 loc) · 1.42 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
# nyuntam
from nyuntam.algorithm import TextGenerationAlgorithm
# ===================================
# quantization
# ===================================
def _import_AutoAWQ() -> TextGenerationAlgorithm:
from .quantization.autoawq import AutoAWQ
return AutoAWQ
def _import_LMQuant() -> TextGenerationAlgorithm:
from .quantization.mit_han_lab_lmquant import LMQuant
return LMQuant
def _import_AQLM() -> TextGenerationAlgorithm:
from .quantization.aqlm import AQLM
return AQLM
# ===================================
# pruning
# ===================================
def _import_Flap() -> TextGenerationAlgorithm:
from .pruning.flap import FlapPruner
return FlapPruner
# ===================================
# engine
# ===================================
def _import_TensorRTLLM() -> TextGenerationAlgorithm:
from .engines.tensorrt_llm import TensorRTLLM
return TensorRTLLM
def __getattr__(name: str) -> TextGenerationAlgorithm:
# quantization
if name == "AutoAWQ":
return _import_AutoAWQ()
elif name == "LMQuant":
return _import_LMQuant()
elif name == "AQLM":
return _import_AQLM()
# pruning
elif name == "FlapPruner":
return _import_Flap()
# engine
elif name == "TensorRTLLM":
return _import_TensorRTLLM()
else:
raise AttributeError(f"Unsupported algorithm: {name}")