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

Commit

Permalink
Merge all models into one models folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Octogonapus committed Feb 24, 2020
1 parent d0d5ffa commit c9c9603
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions axon/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,30 +575,30 @@ def impl_get_task_ip(cluster_name, task_arn, region):
return nics[0]["Association"]["PublicIp"]


def impl_upload_untrained_model(model_path, bucket_name, region):
def impl_upload_model(model_path, bucket_name, region):
"""
Uploads an untrained model to S3.
Uploads a model to S3.
:param model_path: The file path to the model to upload, ending with the name of the model.
:param bucket_name: The S3 bucket name.
:param region: The region, or `None` to pull the region from the environment.
"""
client = make_client("s3", region)
key = "axon-untrained-models/" + os.path.basename(model_path)
key = "axon-models/" + os.path.basename(model_path)
client.upload_file(model_path, bucket_name, key)
print("Uploaded to: {}\n".format(key))


def impl_download_untrained_model(model_path, bucket_name, region):
def impl_download_model(model_path, bucket_name, region):
"""
Downloads an untrained model from S3.
Downloads a model from S3.
:param model_path: The file path to download to, ending with the name of the model.
:param bucket_name: The S3 bucket name.
:param region: The region, or `None` to pull the region from the environment.
"""
client = make_client("s3", region)
key = "axon-untrained-models/" + os.path.basename(model_path)
key = "axon-models/" + os.path.basename(model_path)
client.download_file(bucket_name, key, model_path)
print("Downloaded from: {}\n".format(key))

Expand Down Expand Up @@ -820,30 +820,30 @@ def get_container_ip(task_arn, region):
print(impl_get_task_ip("axon-autogenerated-cluster", task_arn, region))


@cli.command(name="upload-untrained-model")
@cli.command(name="upload-model")
@click.argument("model-path")
@click.option("--region", help="The region to connect to.",
type=click.Choice(region_choices))
def upload_untrained_model(model_path, region):
def upload_model(model_path, region):
"""
Uploads an untrained model from a local file.
Uploads a model from a local file.
MODEL_PATH The path to the model to upload, ending with the name of the model.
"""
impl_upload_untrained_model(model_path, ensure_s3_bucket(region), region)
impl_upload_model(model_path, ensure_s3_bucket(region), region)


@cli.command(name="download-untrained-model")
@cli.command(name="download-model")
@click.argument("model-path")
@click.option("--region", help="The region to connect to.",
type=click.Choice(region_choices))
def download_untrained_model(model_path, region):
def download_model(model_path, region):
"""
Downloads an untrained model to a local file.
Downloads a model to a local file.
MODEL_PATH The path to download the model to, ending with the name of the model.
"""
impl_download_untrained_model(model_path, ensure_s3_bucket(region), region)
impl_download_model(model_path, ensure_s3_bucket(region), region)


@cli.command(name="download-training-script")
Expand Down

0 comments on commit c9c9603

Please sign in to comment.