@@ -344,7 +344,8 @@ def load_from_local(filename, map_location):
344344 filename = osp .expanduser (filename )
345345 if not osp .isfile (filename ):
346346 raise FileNotFoundError (f'{ filename } can not be found.' )
347- checkpoint = torch .load (filename , map_location = map_location , weights_only = False )
347+ checkpoint = torch .load (
348+ filename , map_location = map_location , weights_only = False )
348349 return checkpoint
349350
350351
@@ -412,7 +413,8 @@ def load_from_pavi(filename, map_location=None):
412413 with TemporaryDirectory () as tmp_dir :
413414 downloaded_file = osp .join (tmp_dir , model .name )
414415 model .download (downloaded_file )
415- checkpoint = torch .load (downloaded_file , map_location = map_location , weights_only = False )
416+ checkpoint = torch .load (
417+ downloaded_file , map_location = map_location , weights_only = False )
416418 return checkpoint
417419
418420
@@ -435,7 +437,8 @@ def load_from_ceph(filename, map_location=None, backend='petrel'):
435437 file_backend = get_file_backend (
436438 filename , backend_args = {'backend' : backend })
437439 with io .BytesIO (file_backend .get (filename )) as buffer :
438- checkpoint = torch .load (buffer , map_location = map_location , weights_only = False )
440+ checkpoint = torch .load (
441+ buffer , map_location = map_location , weights_only = False )
439442 return checkpoint
440443
441444
@@ -504,7 +507,8 @@ def load_from_openmmlab(filename, map_location=None):
504507 filename = osp .join (_get_mmengine_home (), model_url )
505508 if not osp .isfile (filename ):
506509 raise FileNotFoundError (f'{ filename } can not be found.' )
507- checkpoint = torch .load (filename , map_location = map_location , weights_only = False )
510+ checkpoint = torch .load (
511+ filename , map_location = map_location , weights_only = False )
508512 return checkpoint
509513
510514
0 commit comments