File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed 
optimum/exporters/openvino Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 3939    _infer_library_from_model_name_or_path ,
4040    _OpenClipForZeroShotImageClassification ,
4141)
42+ from  optimum .utils  import  is_auto_gptq_available , is_gptqmodel_available 
4243from  optimum .utils .save_utils  import  maybe_load_preprocessors 
4344
4445from  .utils  import  (
@@ -339,7 +340,12 @@ def main_export(
339340                orig_post_init_model  =  GPTQQuantizer .post_init_model 
340341
341342                def  post_init_model (self , model ):
342-                     from  auto_gptq  import  exllama_set_max_input_length 
343+                     if  is_gptqmodel_available ():
344+                         from  gptqmodel  import  exllama_set_max_input_length 
345+                     elif  is_auto_gptq_available ():
346+                         from  auto_gptq  import  exllama_set_max_input_length 
347+                     else :
348+                         raise  ValueError ("neither auto_gptq nor gptqmodel is available" )
343349
344350                    class  StoreAttr (object ):
345351                        pass 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments