Skip to content
This repository was archived by the owner on Sep 26, 2020. It is now read-only.

Commit 27ee5ca

Browse files
committed
Upload models in the test results to the model prefix
1 parent 65a0048 commit 27ee5ca

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

axon/client.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -716,9 +716,15 @@ def impl_upload_training_results(job_id, output_dir, bucket_name, region):
716716
files_to_upload = [os.path.join(output_dir, it) for it in os.listdir(output_dir)]
717717
files_to_upload = [it for it in files_to_upload if os.path.isfile(it)]
718718
for elem in files_to_upload:
719-
key = "axon-training-results/{}/{}".format(job_id, os.path.basename(elem))
720-
client.upload_file(elem, bucket_name, key)
721-
print("Uploaded to: {}\n".format(key))
719+
ext = os.path.splitext(elem)[1].lower()
720+
# Upload model files to the model prefix instead of the test result prefix so that users
721+
# can select them as models to start new Jobs with.
722+
if ext == ".h5" or ext == ".hdf5":
723+
impl_upload_model(os.path.abspath(elem), bucket_name, region)
724+
else:
725+
key = "axon-training-results/{}/{}".format(job_id, os.path.basename(elem))
726+
client.upload_file(elem, bucket_name, key)
727+
print("Uploaded to: {}\n".format(key))
722728

723729

724730
def create_progress_prefix(job_id):

0 commit comments

Comments
 (0)