@@ -500,7 +500,7 @@ def exllama_ops_load_and_reg(qcfg=None, run_unit_test=False):
500500 1. need to install gptqmodel python package
501501 2. Op registration signature changed drastically from torch 2.1 - 2.4. TODO: add 2.4 support
502502
503- see https://github.com/ModelCloud/GPTQModel/tree/main?tab=readme-ov-file for installation instructions
503+ see https://github.com/ModelCloud/GPTQModel for installation instructions
504504 """
505505 if qcfg is None :
506506 qcfg = {}
@@ -509,7 +509,9 @@ def exllama_ops_load_and_reg(qcfg=None, run_unit_test=False):
509509
510510 namespace = "gptqmodel_gemm"
511511 # check before compile
512- if hasattr (torch .ops , namespace ) and hasattr (torch .ops .gptqmodel_gemm , "exv1_i4f16" ):
512+ if hasattr (torch .ops , namespace ) and hasattr (
513+ torch .ops .gptqmodel_gemm , "exv1_i4f16"
514+ ):
513515 logger .info ("Custom GPTQModel functions have been loaded already!" )
514516 qcfg ["GPTQMODEL_AVAILABLE" ] = True
515517 need_registration = False
@@ -623,7 +625,8 @@ def exv2_i4f16_fxinputs_abstract(
623625 )
624626
625627 logger .info (
626- f"New GPTQModel gemm functions have been loaded and registered to torch.ops.{ namespace } ."
628+ f"New GPTQModel gemm functions have been loaded and registered to \
629+ torch.ops.{ namespace } ."
627630 )
628631 if qcfg :
629632 qcfg ["GPTQMODEL_AVAILABLE" ] = True
@@ -1110,10 +1113,14 @@ def swap_nnlinear_to_quantlinear(model, qconfig, prefix=None, qlinear2use=None):
11101113 QuantLinear = qlinear2use
11111114 elif exVer == 1 :
11121115 # Third Party
1113- from gptqmodel .nn_modules .qlinear .exllama import ExllamaQuantLinear as QuantLinear
1116+ from gptqmodel .nn_modules .qlinear .exllama import (
1117+ ExllamaQuantLinear as QuantLinear ,
1118+ )
11141119 else :
11151120 # Third Party
1116- from gptqmodel .nn_modules .qlinear .exllamav2 import ExllamaV2QuantLinear as QuantLinear
1121+ from gptqmodel .nn_modules .qlinear .exllamav2 import (
1122+ ExllamaV2QuantLinear as QuantLinear ,
1123+ )
11171124
11181125 num_swapped = 0
11191126 for n , m in model .named_modules ():
0 commit comments