You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ads/opctl/conda/cmds.py
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -311,7 +311,9 @@ def _install(
311
311
"""
312
312
ns, bucket, path, slug=parse_conda_uri(conda_uri)
313
313
ifbucket=="service-conda-packs":
314
-
raiseValueError("Download service conda pack is not allowed. Only custom conda pack can be downloaded to local machine. You need to publish it to your own bucket first.")
314
+
raiseValueError(
315
+
"Download service conda pack is not allowed. Only custom conda pack can be downloaded to local machine. You need to publish it to your own bucket first."
Copy file name to clipboardExpand all lines: ads/opctl/model/cli.py
+34-6Lines changed: 34 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -19,18 +19,46 @@ def commands():
19
19
20
20
@commands.command()
21
21
@click.argument("ocid", required=True)
22
-
@click.option("--model-save-folder", "-mf", nargs=1, required=False, default=DEFAULT_MODEL_FOLDER, help="Which location to store model artifact folders. Defaults to ~/.ads_ops/models. This is only used when model id is passed to `ocid` and a local predict is conducted.")
22
+
@click.option(
23
+
"--model-save-folder",
24
+
"-mf",
25
+
nargs=1,
26
+
required=False,
27
+
default=DEFAULT_MODEL_FOLDER,
28
+
help="Which location to store model artifact folders. Defaults to ~/.ads_ops/models. This is only used when model id is passed to `ocid` and a local predict is conducted.",
29
+
)
23
30
@click.option(
24
31
"--auth",
25
32
"-a",
26
33
help="authentication method",
27
34
type=click.Choice(AuthType.values()),
28
35
default=None,
29
36
)
30
-
@click.option("--bucket-uri", nargs=1, required=False, help="The OCI Object Storage URI where model artifacts will be copied to. The `bucket_uri` is only necessary for uploading large artifacts which size is greater than 2GB. Example: `oci://<bucket_name>@<namespace>/prefix/`. This is only used when the model id is passed.")
31
-
@click.option("--region", nargs=1, required=False, help="The destination Object Storage bucket region. By default the value will be extracted from the `OCI_REGION_METADATA` environment variables. This is only used when the model id is passed.")
32
-
@click.option("--timeout", nargs=1, required=False, help="The connection timeout in seconds for the client. This is only used when the model id is passed.")
help="The OCI Object Storage URI where model artifacts will be copied to. The `bucket_uri` is only necessary for uploading large artifacts which size is greater than 2GB. Example: `oci://<bucket_name>@<namespace>/prefix/`. This is only used when the model id is passed.",
42
+
)
43
+
@click.option(
44
+
"--region",
45
+
nargs=1,
46
+
required=False,
47
+
help="The destination Object Storage bucket region. By default the value will be extracted from the `OCI_REGION_METADATA` environment variables. This is only used when the model id is passed.",
48
+
)
49
+
@click.option(
50
+
"--timeout",
51
+
nargs=1,
52
+
required=False,
53
+
help="The connection timeout in seconds for the client. This is only used when the model id is passed.",
logger.info(f"No cached model found. Downloading the model {ocid} to {artifact_directory}. If you already have a copy of the model, specify `artifact_directory` instead of `ocid`. You can specify `model_save_folder` to decide where to store the model artifacts.")
f"No cached model found. Downloading the model {ocid} to {artifact_directory}. If you already have a copy of the model, specify `artifact_directory` instead of `ocid`. You can specify `model_save_folder` to decide where to store the model artifacts."
39
+
)
40
+
_download_model(
41
+
ocid=ocid,
42
+
artifact_directory=artifact_directory,
43
+
region=region,
44
+
bucket_uri=bucket_uri,
45
+
timeout=timeout,
46
+
force_overwrite=force_overwrite,
47
+
oci_auth=oci_auth,
48
+
)
35
49
else:
36
50
logger.error(f"Model already exists. Set `force_overwrite=True` to overwrite.")
37
-
raiseValueError(f"Model already exists. Set `force_overwrite=True` to overwrite.")
51
+
raiseValueError(
52
+
f"Model already exists. Set `force_overwrite=True` to overwrite."
0 commit comments