File tree Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change 1313 is_k_diffusion_available ,
1414 is_librosa_available ,
1515 is_note_seq_available ,
16+ is_nunchaku_available ,
1617 is_onnx_available ,
1718 is_opencv_available ,
1819 is_optimum_quanto_available ,
99100else :
100101 _import_structure ["quantizers.quantization_config" ].append ("TorchAoConfig" )
101102
103+ try :
104+ if not is_torch_available () and not is_accelerate_available () and not is_nunchaku_available ():
105+ raise OptionalDependencyNotAvailable ()
106+ except OptionalDependencyNotAvailable :
107+ from .utils import dummy_nunchaku_objects
108+
109+ _import_structure ["utils.dummy_nunchaku_objects" ] = [
110+ name for name in dir (dummy_nunchaku_objects ) if not name .startswith ("_" )
111+ ]
112+ else :
113+ _import_structure ["quantizers.quantization_config" ].append ("NunchakuConfig" )
114+
102115try :
103116 if not is_torch_available () and not is_accelerate_available () and not is_optimum_quanto_available ():
104117 raise OptionalDependencyNotAvailable ()
791804 else :
792805 from .quantizers .quantization_config import QuantoConfig
793806
807+ try :
808+ if not is_nunchaku_available ():
809+ raise OptionalDependencyNotAvailable ()
810+ except OptionalDependencyNotAvailable :
811+ from .utils .dummy_optimum_quanto_objects import *
812+ else :
813+ from .quantizers .quantization_config import NunchakuConfig
814+
794815 try :
795816 if not is_onnx_available ():
796817 raise OptionalDependencyNotAvailable ()
Original file line number Diff line number Diff line change 1+ # This file is autogenerated by the command `make fix-copies`, do not edit.
2+ from ..utils import DummyObject , requires_backends
3+
4+
5+ class NunchakuConfig (metaclass = DummyObject ):
6+ _backends = ["nunchaku" ]
7+
8+ def __init__ (self , * args , ** kwargs ):
9+ requires_backends (self , ["nunchaku" ])
10+
11+ @classmethod
12+ def from_config (cls , * args , ** kwargs ):
13+ requires_backends (cls , ["nunchaku" ])
14+
15+ @classmethod
16+ def from_pretrained (cls , * args , ** kwargs ):
17+ requires_backends (cls , ["nunchaku" ])
You can’t perform that action at this time.
0 commit comments