@@ -577,32 +577,60 @@ def impl_get_task_ip(cluster_name, task_arn, region):
577
577
return nics [0 ]["Association" ]["PublicIp" ]
578
578
579
579
580
- def impl_upload_model_file ( model_name , bucket_name , region ):
580
+ def impl_upload_untrained_model_file ( model_path , bucket_name , region ):
581
581
"""
582
- Uploads a model to S3.
582
+ Uploads an untrained model to S3.
583
583
584
- :param model_name : The filename of the model to upload (must be in the current directory) .
584
+ :param model_path : The file path to the model to upload, ending with the name of the model .
585
585
:param bucket_name: The S3 bucket name.
586
586
:param region: The region, or `None` to pull the region from the environment.
587
587
"""
588
588
client = make_client ("s3" , region )
589
- remote_path = "axon-uploaded-trained- models/" + os .path .basename (model_name )
590
- client .upload_file (model_name , bucket_name , remote_path )
591
- print ("Uploaded to: {}\n " .format (remote_path ))
589
+ key = "axon-untrained- models/" + os .path .basename (model_path )
590
+ client .upload_file (model_path , bucket_name , key )
591
+ print ("Uploaded to: {}\n " .format (key ))
592
592
593
593
594
- def impl_download_model_file ( model_name , bucket_name , region ):
594
+ def impl_download_untrained_model_file ( model_path , bucket_name , region ):
595
595
"""
596
- Downloads a model from S3.
596
+ Downloads an untrained model from S3.
597
597
598
- :param model_name : The filename of the model to download (must be in the current directory) .
598
+ :param model_path : The file path to download to, ending with the name of the model .
599
599
:param bucket_name: The S3 bucket name.
600
600
:param region: The region, or `None` to pull the region from the environment.
601
601
"""
602
602
client = make_client ("s3" , region )
603
- remote_path = "axon-uploaded-trained-models/" + os .path .basename (model_name )
604
- client .download_file (bucket_name , remote_path , model_name )
605
- print ("Downloaded from: {}\n " .format (remote_path ))
603
+ key = "axon-untrained-models/" + os .path .basename (model_path )
604
+ client .download_file (bucket_name , key , model_path )
605
+ print ("Downloaded from: {}\n " .format (key ))
606
+
607
+
608
+ def impl_upload_trained_model_file (model_path , bucket_name , region ):
609
+ """
610
+ Uploads an trained model to S3.
611
+
612
+ :param model_path: The file path to the model to upload, ending with the name of the model.
613
+ :param bucket_name: The S3 bucket name.
614
+ :param region: The region, or `None` to pull the region from the environment.
615
+ """
616
+ client = make_client ("s3" , region )
617
+ key = "axon-trained-models/" + os .path .basename (model_path )
618
+ client .upload_file (model_path , bucket_name , key )
619
+ print ("Uploaded to: {}\n " .format (key ))
620
+
621
+
622
+ def impl_download_trained_model_file (model_path , bucket_name , region ):
623
+ """
624
+ Downloads an trained model from S3.
625
+
626
+ :param model_path: The file path to download to, ending with the name of the model.
627
+ :param bucket_name: The S3 bucket name.
628
+ :param region: The region, or `None` to pull the region from the environment.
629
+ """
630
+ client = make_client ("s3" , region )
631
+ key = "axon-trained-models/" + os .path .basename (model_path )
632
+ client .download_file (bucket_name , key , model_path )
633
+ print ("Downloaded from: {}\n " .format (key ))
606
634
607
635
608
636
def impl_download_training_script (script_name , bucket_name , region ):
@@ -614,7 +642,7 @@ def impl_download_training_script(script_name, bucket_name, region):
614
642
:param region: The region, or `None` to pull the region from the environment.
615
643
"""
616
644
client = make_client ("s3" , region )
617
- remote_path = "axon-uploaded- training-scripts/" + os .path .basename (script_name )
645
+ remote_path = "axon-training-scripts/" + os .path .basename (script_name )
618
646
client .download_file (bucket_name , remote_path , script_name )
619
647
print ("Downloaded from: {}\n " .format (remote_path ))
620
648
@@ -682,7 +710,7 @@ def cli():
682
710
@click .argument ("task-family" )
683
711
@click .option ("--revision" , default = None ,
684
712
help = "The revision of the task. Set to None to use the latest revision." )
685
- @click .option ("--region" , default = "us-east-1" , help = "The region to connect to." )
713
+ @click .option ("--region" , help = "The region to connect to." )
686
714
def start_axon (cluster_name , task_family , revision , region ):
687
715
impl_ensure_configuration (cluster_name , task_family , region )
688
716
task_arn = impl_start_task (cluster_name , task_family , revision , region )
@@ -698,7 +726,7 @@ def start_axon(cluster_name, task_family, revision, region):
698
726
@cli .command (name = "ensure-configuration" )
699
727
@click .argument ("cluster-name" )
700
728
@click .argument ("task-family" )
701
- @click .option ("--region" , default = "us-east-1" , help = "The region to connect to." )
729
+ @click .option ("--region" , help = "The region to connect to." )
702
730
def ensure_configuration (cluster_name , task_family , region ):
703
731
impl_ensure_configuration (cluster_name , task_family , region )
704
732
@@ -708,7 +736,7 @@ def ensure_configuration(cluster_name, task_family, region):
708
736
@click .argument ("task-family" )
709
737
@click .option ("--revision" , default = None ,
710
738
help = "The revision of the task. Set to None to use the latest revision." )
711
- @click .option ("--region" , default = "us-east-1" , help = "The region to connect to." )
739
+ @click .option ("--region" , help = "The region to connect to." )
712
740
@click .option ("--stop-after/--no-stop-after" , default = False ,
713
741
help = "Whether to stop the task immediately after creating it." )
714
742
def start_task (cluster_name , task_family , revision , region , stop_after ):
@@ -726,55 +754,71 @@ def start_task(cluster_name, task_family, revision, region, stop_after):
726
754
@cli .command (name = "stop-task" )
727
755
@click .argument ("cluster-name" )
728
756
@click .argument ("task" )
729
- @click .option ("--region" , default = "us-east-1" , help = "The region to connect to." )
757
+ @click .option ("--region" , help = "The region to connect to." )
730
758
def stop_task (cluster_name , task , region ):
731
759
impl_stop_task (cluster_name , task , region )
732
760
733
761
734
762
@cli .command (name = "get-container-ip" )
735
763
@click .argument ("cluster-name" )
736
764
@click .argument ("task" )
737
- @click .option ("--region" , default = "us-east-1" , help = "The region to connect to." )
765
+ @click .option ("--region" , help = "The region to connect to." )
738
766
def get_container_ip (cluster_name , task , region ):
739
767
print (impl_get_task_ip (cluster_name , task , region ))
740
768
741
769
742
- @cli .command (name = "upload-model-file" )
770
+ @cli .command (name = "upload-untrained-model-file" )
771
+ @click .argument ("model-name" )
772
+ @click .argument ("bucket-name" )
773
+ @click .option ("--region" , help = "The region to connect to." )
774
+ def upload_untrained_model_file (model_name , bucket_name , region ):
775
+ impl_upload_untrained_model_file (model_name , bucket_name , region )
776
+
777
+
778
+ @cli .command (name = "download-untrained-model-file" )
779
+ @click .argument ("model-name" )
780
+ @click .argument ("bucket-name" )
781
+ @click .option ("--region" , help = "The region to connect to." )
782
+ def download_untrained_model_file (model_name , bucket_name , region ):
783
+ impl_download_untrained_model_file (model_name , bucket_name , region )
784
+
785
+
786
+ @cli .command (name = "upload-trained-model-file" )
743
787
@click .argument ("model-name" )
744
788
@click .argument ("bucket-name" )
745
- @click .option ("--region" , default = "us-east-1" , help = "The region to connect to." )
746
- def upload_model_file (model_name , bucket_name , region ):
747
- impl_upload_model_file (model_name , bucket_name , region )
789
+ @click .option ("--region" , help = "The region to connect to." )
790
+ def upload_trained_model_file (model_name , bucket_name , region ):
791
+ impl_upload_trained_model_file (model_name , bucket_name , region )
748
792
749
793
750
- @cli .command (name = "download-model-file" )
794
+ @cli .command (name = "download-trained- model-file" )
751
795
@click .argument ("model-name" )
752
796
@click .argument ("bucket-name" )
753
- @click .option ("--region" , default = "us-east-1" , help = "The region to connect to." )
754
- def download_model_file (model_name , bucket_name , region ):
755
- impl_download_model_file (model_name , bucket_name , region )
797
+ @click .option ("--region" , help = "The region to connect to." )
798
+ def download_trained_model_file (model_name , bucket_name , region ):
799
+ impl_download_trained_model_file (model_name , bucket_name , region )
756
800
757
801
758
802
@cli .command (name = "download-training-script" )
759
803
@click .argument ("script-name" )
760
804
@click .argument ("bucket-name" )
761
- @click .option ("--region" , default = "us-east-1" , help = "The region to connect to." )
805
+ @click .option ("--region" , help = "The region to connect to." )
762
806
def download_training_script (script_name , bucket_name , region ):
763
807
impl_download_training_script (script_name , bucket_name , region )
764
808
765
809
766
810
@cli .command (name = "download-dataset" )
767
811
@click .argument ("dataset-name" )
768
812
@click .argument ("bucket-name" )
769
- @click .option ("--region" , default = "us-east-1" , help = "The region to connect to." )
813
+ @click .option ("--region" , help = "The region to connect to." )
770
814
def download_dataset (dataset_name , bucket_name , region ):
771
815
impl_download_dataset (dataset_name , bucket_name , region )
772
816
773
817
774
818
@cli .command (name = "upload-dataset" )
775
819
@click .argument ("dataset-name" )
776
820
@click .argument ("bucket-name" )
777
- @click .option ("--region" , default = "us-east-1" , help = "The region to connect to." )
821
+ @click .option ("--region" , help = "The region to connect to." )
778
822
def upload_dataset (dataset_name , bucket_name , region ):
779
823
impl_upload_dataset (dataset_name , bucket_name , region )
780
824
@@ -784,6 +828,6 @@ def upload_dataset(dataset_name, bucket_name, region):
784
828
@click .argument ("dataset-name" )
785
829
@click .argument ("progress-text" )
786
830
@click .argument ("bucket-name" )
787
- @click .option ("--region" , default = "us-east-1" , help = "The region to connect to." )
831
+ @click .option ("--region" , help = "The region to connect to." )
788
832
def update_training_progress (model_name , dataset_name , progress_text , bucket_name , region ):
789
833
impl_update_training_progress (model_name , dataset_name , progress_text , bucket_name , region )
0 commit comments