mirror of
https://github.com/gryf/coach.git
synced 2025-12-18 11:40:18 +01:00
Don't download when checkpoint files are already present (#109)
* add check if checkpoint file present
This commit is contained in:
committed by
Balaji Subramaniam
parent
b94239234a
commit
dd18959e53
@@ -110,7 +110,8 @@ class S3DataStore(DataStore):
|
|||||||
objects = self.mc.list_objects_v2(self.params.bucket_name, prefix=rel_path, recursive=True)
|
objects = self.mc.list_objects_v2(self.params.bucket_name, prefix=rel_path, recursive=True)
|
||||||
for obj in objects:
|
for obj in objects:
|
||||||
filename = os.path.abspath(os.path.join(self.params.checkpoint_dir, obj.object_name))
|
filename = os.path.abspath(os.path.join(self.params.checkpoint_dir, obj.object_name))
|
||||||
self.mc.fget_object(obj.bucket_name, obj.object_name, filename)
|
if not os.path.exists(filename):
|
||||||
|
self.mc.fget_object(obj.bucket_name, obj.object_name, filename)
|
||||||
|
|
||||||
except ResponseError as e:
|
except ResponseError as e:
|
||||||
print("Got exception: %s\n while loading from S3", e)
|
print("Got exception: %s\n while loading from S3", e)
|
||||||
|
|||||||
Reference in New Issue
Block a user