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 
4243
4344from  .utils  import  (
4445    _MAX_UNCOMPRESSED_SIZE ,
@@ -344,7 +345,12 @@ def main_export(
344345                orig_post_init_model  =  GPTQQuantizer .post_init_model 
345346
346347                def  post_init_model (self , model ):
347-                     from  auto_gptq  import  exllama_set_max_input_length 
348+                     if  is_gptqmodel_available ():
349+                         from  gptqmodel  import  exllama_set_max_input_length 
350+                     elif  is_auto_gptq_available ():
351+                         from  auto_gptq  import  exllama_set_max_input_length 
352+                     else :
353+                         raise  ValueError ("neither auto_gptq nor gptqmodel is available" )
348354
349355                    class  StoreAttr (object ):
350356                        pass 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments