File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -449,7 +449,7 @@ def module_is_offloaded(module):
449449        # Enable generic support for Intel Gaudi accelerator using GPU/HPU migration 
450450        if  kwargs .pop ("hpu_migration" , True ) and  is_hpu_available ():
451451            os .environ ["PT_HPU_MAX_COMPOUND_OP_SIZE" ] =  "1" 
452-             logger .debug (' Environment variable set: PT_HPU_MAX_COMPOUND_OP_SIZE=1'  )
452+             logger .debug (" Environment variable set: PT_HPU_MAX_COMPOUND_OP_SIZE=1"  )
453453
454454        module_names , _  =  self ._get_signature_keys (self )
455455        modules  =  [getattr (self , n , None ) for  n  in  module_names ]
Original file line number Diff line number Diff line change @@ -335,6 +335,7 @@ def is_optimum_quanto_available():
335335def  is_timm_available ():
336336    return  _timm_available 
337337
338+ 
338339def  is_hpu_available ():
339340    if  (
340341        importlib .util .find_spec ("habana_frameworks" ) is  None 
@@ -343,12 +344,14 @@ def is_hpu_available():
343344        return  False 
344345
345346    os .environ ["PT_HPU_GPU_MIGRATION" ] =  "1" 
346-     logger .debug (' Environment variable set: PT_HPU_GPU_MIGRATION=1'  )
347+     logger .debug (" Environment variable set: PT_HPU_GPU_MIGRATION=1"  )
347348
348-     import  torch 
349349    import  habana_frameworks .torch   # noqa: F401 
350+     import  torch 
351+ 
350352    return  hasattr (torch , "hpu" ) and  torch .hpu .is_available ()
351353
354+ 
352355# docstyle-ignore 
353356FLAX_IMPORT_ERROR  =  """ 
354357{0} requires the FLAX library but it was not found in your environment. Checkout the instructions on the 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments