oracle-ads 2.12.10rc0__py3-none-any.whl → 2.12.11__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. ads/aqua/__init__.py +2 -1
  2. ads/aqua/app.py +30 -16
  3. ads/aqua/client/__init__.py +3 -0
  4. ads/aqua/client/client.py +799 -0
  5. ads/aqua/evaluation/evaluation.py +20 -12
  6. ads/aqua/extension/aqua_ws_msg_handler.py +14 -7
  7. ads/aqua/extension/base_handler.py +12 -9
  8. ads/aqua/extension/model_handler.py +6 -1
  9. ads/aqua/finetuning/entities.py +3 -0
  10. ads/aqua/finetuning/finetuning.py +32 -1
  11. ads/aqua/model/entities.py +2 -1
  12. ads/aqua/model/model.py +136 -76
  13. ads/aqua/modeldeployment/deployment.py +22 -10
  14. ads/cli.py +16 -8
  15. ads/opctl/operator/lowcode/common/transformations.py +38 -3
  16. ads/opctl/operator/lowcode/common/utils.py +11 -1
  17. ads/opctl/operator/lowcode/forecast/__main__.py +10 -0
  18. ads/opctl/operator/lowcode/forecast/model/forecast_datasets.py +1 -1
  19. ads/opctl/operator/lowcode/forecast/operator_config.py +31 -0
  20. ads/opctl/operator/lowcode/forecast/schema.yaml +63 -0
  21. ads/opctl/operator/lowcode/forecast/whatifserve/__init__.py +7 -0
  22. ads/opctl/operator/lowcode/forecast/whatifserve/deployment_manager.py +233 -0
  23. ads/opctl/operator/lowcode/forecast/whatifserve/score.py +238 -0
  24. {oracle_ads-2.12.10rc0.dist-info → oracle_ads-2.12.11.dist-info}/METADATA +3 -1
  25. {oracle_ads-2.12.10rc0.dist-info → oracle_ads-2.12.11.dist-info}/RECORD +28 -23
  26. {oracle_ads-2.12.10rc0.dist-info → oracle_ads-2.12.11.dist-info}/LICENSE.txt +0 -0
  27. {oracle_ads-2.12.10rc0.dist-info → oracle_ads-2.12.11.dist-info}/WHEEL +0 -0
  28. {oracle_ads-2.12.10rc0.dist-info → oracle_ads-2.12.11.dist-info}/entry_points.txt +0 -0
ads/aqua/__init__.py CHANGED
@@ -6,7 +6,8 @@
6
6
  import os
7
7
  from logging import getLogger
8
8
 
9
- from ads import set_auth
9
+ from ads import logger, set_auth
10
+ from ads.aqua.client.client import AsyncClient, Client
10
11
  from ads.aqua.common.utils import fetch_service_compartment
11
12
  from ads.config import OCI_RESOURCE_PRINCIPAL_VERSION
12
13
 
ads/aqua/app.py CHANGED
@@ -1,9 +1,10 @@
1
1
  #!/usr/bin/env python
2
- # Copyright (c) 2024 Oracle and/or its affiliates.
2
+ # Copyright (c) 2024, 2025 Oracle and/or its affiliates.
3
3
  # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
4
4
 
5
5
  import json
6
6
  import os
7
+ import traceback
7
8
  from dataclasses import fields
8
9
  from typing import Dict, Union
9
10
 
@@ -23,7 +24,7 @@ from ads.aqua.common.utils import (
23
24
  from ads.aqua.constants import UNKNOWN
24
25
  from ads.common import oci_client as oc
25
26
  from ads.common.auth import default_signer
26
- from ads.common.utils import extract_region
27
+ from ads.common.utils import extract_region, is_path_exists
27
28
  from ads.config import (
28
29
  AQUA_TELEMETRY_BUCKET,
29
30
  AQUA_TELEMETRY_BUCKET_NS,
@@ -296,33 +297,46 @@ class AquaApp:
296
297
  raise AquaRuntimeError(f"Target model {oci_model.id} is not Aqua model.")
297
298
 
298
299
  config = {}
299
- artifact_path = get_artifact_path(oci_model.custom_metadata_list)
300
+ # if the current model has a service model tag, then
301
+ if Tags.AQUA_SERVICE_MODEL_TAG in oci_model.freeform_tags:
302
+ base_model_ocid = oci_model.freeform_tags[Tags.AQUA_SERVICE_MODEL_TAG]
303
+ logger.info(
304
+ f"Base model found for the model: {oci_model.id}. "
305
+ f"Loading {config_file_name} for base model {base_model_ocid}."
306
+ )
307
+ base_model = self.ds_client.get_model(base_model_ocid).data
308
+ artifact_path = get_artifact_path(base_model.custom_metadata_list)
309
+ else:
310
+ logger.info(f"Loading {config_file_name} for model {oci_model.id}...")
311
+ artifact_path = get_artifact_path(oci_model.custom_metadata_list)
312
+
300
313
  if not artifact_path:
301
- logger.error(
314
+ logger.debug(
302
315
  f"Failed to get artifact path from custom metadata for the model: {model_id}"
303
316
  )
304
317
  return config
305
318
 
306
- try:
307
- config_path = f"{os.path.dirname(artifact_path)}/config/"
308
- config = load_config(
309
- config_path,
310
- config_file_name=config_file_name,
311
- )
312
- except Exception:
313
- # todo: temp fix for issue related to config load for byom models, update logic to choose the right path
319
+ config_path = f"{os.path.dirname(artifact_path)}/config/"
320
+ if not is_path_exists(config_path):
321
+ config_path = f"{artifact_path.rstrip('/')}/config/"
322
+
323
+ config_file_path = f"{config_path}{config_file_name}"
324
+ if is_path_exists(config_file_path):
314
325
  try:
315
- config_path = f"{artifact_path.rstrip('/')}/config/"
316
326
  config = load_config(
317
327
  config_path,
318
328
  config_file_name=config_file_name,
319
329
  )
320
330
  except Exception:
321
- pass
331
+ logger.debug(
332
+ f"Error loading the {config_file_name} at path {config_path}.\n"
333
+ f"{traceback.format_exc()}"
334
+ )
322
335
 
323
336
  if not config:
324
- logger.error(
325
- f"{config_file_name} is not available for the model: {model_id}. Check if the custom metadata has the artifact path set."
337
+ logger.debug(
338
+ f"{config_file_name} is not available for the model: {model_id}. "
339
+ f"Check if the custom metadata has the artifact path set."
326
340
  )
327
341
  return config
328
342
 
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env python
2
+ # Copyright (c) 2025 Oracle and/or its affiliates.
3
+ # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/