From 35ee6e2ab16bda87b58057b944bd65e2ed465ba9 Mon Sep 17 00:00:00 2001 From: PacificDou Date: Thu, 15 Aug 2024 19:44:36 +0000 Subject: [PATCH 1/3] add args --- roboflow/adapters/deploymentapi.py | 4 +++- roboflow/deployment.py | 10 ++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/roboflow/adapters/deploymentapi.py b/roboflow/adapters/deploymentapi.py index d0fec354..e763c0e1 100644 --- a/roboflow/adapters/deploymentapi.py +++ b/roboflow/adapters/deploymentapi.py @@ -7,7 +7,7 @@ class DeploymentApiError(Exception): pass -def add_deployment(api_key, machine_type, deployment_name, inference_version): +def add_deployment(api_key, machine_type, duration, delete_on_expiration, deployment_name, inference_version): url = f"{DEDICATED_DEPLOYMENT_URL}/add" response = requests.post( url, @@ -15,6 +15,8 @@ def add_deployment(api_key, machine_type, deployment_name, inference_version): "api_key": api_key, # "security_level": security_level, "machine_type": machine_type, + "duration": duration, + "delete_on_expiration": delete_on_expiration, "deployment_name": deployment_name, "inference_version": inference_version, }, diff --git a/roboflow/deployment.py b/roboflow/deployment.py index ee11caad..44cf96a9 100644 --- a/roboflow/deployment.py +++ b/roboflow/deployment.py @@ -29,6 +29,14 @@ def add_deployment_parser(subparsers): deployment_add_parser.add_argument( "-m", dest="machine_type", help="machine type, run `roboflow deployment machine_type` to see available options" ) + deployment_add_parser.add_argument( + "-t", dest="duration", help="duration, how long you want to keep the deployment (unit: hour, default: 3)", + type=float, default=3 + ) + deployment_add_parser.add_argument( + "-e", dest="delete_on_expiration", help="delete when expired (default: True)", + type=bool, default=True + ) deployment_add_parser.add_argument( "-n", dest="deployment_name", help="deployment name, must contain 3-10 lowercase characters" ) @@ -60,6 +68,8 @@ def add_deployment(args): api_key, # args.security_level, args.machine_type, + args.duration, + args.delete_on_expiration, args.deployment_name, args.inference_version, ) From 87ce48d0f647f1ab40addf9803e48d7c4c622cde Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 15 Aug 2024 19:49:58 +0000 Subject: [PATCH 2/3] =?UTF-8?q?fix(pre=5Fcommit):=20=F0=9F=8E=A8=20auto=20?= =?UTF-8?q?format=20pre-commit=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- roboflow/deployment.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/roboflow/deployment.py b/roboflow/deployment.py index 44cf96a9..fce12bfa 100644 --- a/roboflow/deployment.py +++ b/roboflow/deployment.py @@ -30,12 +30,14 @@ def add_deployment_parser(subparsers): "-m", dest="machine_type", help="machine type, run `roboflow deployment machine_type` to see available options" ) deployment_add_parser.add_argument( - "-t", dest="duration", help="duration, how long you want to keep the deployment (unit: hour, default: 3)", - type=float, default=3 + "-t", + dest="duration", + help="duration, how long you want to keep the deployment (unit: hour, default: 3)", + type=float, + default=3, ) deployment_add_parser.add_argument( - "-e", dest="delete_on_expiration", help="delete when expired (default: True)", - type=bool, default=True + "-e", dest="delete_on_expiration", help="delete when expired (default: True)", type=bool, default=True ) deployment_add_parser.add_argument( "-n", dest="deployment_name", help="deployment name, must contain 3-10 lowercase characters" From 26fdbce18f4adaea67a09acb13fabcf6bf5136c3 Mon Sep 17 00:00:00 2001 From: PacificDou Date: Thu, 15 Aug 2024 19:52:06 +0000 Subject: [PATCH 3/3] bump version to 1.1.40 --- roboflow/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roboflow/__init__.py b/roboflow/__init__.py index c75d15f9..858ce141 100644 --- a/roboflow/__init__.py +++ b/roboflow/__init__.py @@ -15,7 +15,7 @@ from roboflow.models import CLIPModel, GazeModel # noqa: F401 from roboflow.util.general import write_line -__version__ = "1.1.39" +__version__ = "1.1.40" def check_key(api_key, model, notebook, num_retries=0):