oracle-ads 2.12.9__py3-none-any.whl → 2.12.10__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 (74) hide show
  1. ads/aqua/__init__.py +4 -3
  2. ads/aqua/app.py +28 -16
  3. ads/aqua/client/__init__.py +3 -0
  4. ads/aqua/client/client.py +799 -0
  5. ads/aqua/common/enums.py +3 -0
  6. ads/aqua/common/utils.py +62 -2
  7. ads/aqua/data.py +2 -19
  8. ads/aqua/evaluation/evaluation.py +20 -12
  9. ads/aqua/extension/aqua_ws_msg_handler.py +14 -7
  10. ads/aqua/extension/base_handler.py +12 -9
  11. ads/aqua/extension/finetune_handler.py +8 -14
  12. ads/aqua/extension/model_handler.py +24 -2
  13. ads/aqua/finetuning/constants.py +5 -2
  14. ads/aqua/finetuning/entities.py +67 -17
  15. ads/aqua/finetuning/finetuning.py +69 -54
  16. ads/aqua/model/entities.py +3 -1
  17. ads/aqua/model/model.py +196 -98
  18. ads/aqua/modeldeployment/deployment.py +22 -10
  19. ads/cli.py +16 -8
  20. ads/common/auth.py +9 -9
  21. ads/llm/autogen/__init__.py +2 -0
  22. ads/llm/autogen/constants.py +15 -0
  23. ads/llm/autogen/reports/__init__.py +2 -0
  24. ads/llm/autogen/reports/base.py +67 -0
  25. ads/llm/autogen/reports/data.py +103 -0
  26. ads/llm/autogen/reports/session.py +526 -0
  27. ads/llm/autogen/reports/templates/chat_box.html +13 -0
  28. ads/llm/autogen/reports/templates/chat_box_lt.html +5 -0
  29. ads/llm/autogen/reports/templates/chat_box_rt.html +6 -0
  30. ads/llm/autogen/reports/utils.py +56 -0
  31. ads/llm/autogen/v02/__init__.py +4 -0
  32. ads/llm/autogen/{client_v02.py → v02/client.py} +23 -10
  33. ads/llm/autogen/v02/log_handlers/__init__.py +2 -0
  34. ads/llm/autogen/v02/log_handlers/oci_file_handler.py +83 -0
  35. ads/llm/autogen/v02/loggers/__init__.py +6 -0
  36. ads/llm/autogen/v02/loggers/metric_logger.py +320 -0
  37. ads/llm/autogen/v02/loggers/session_logger.py +580 -0
  38. ads/llm/autogen/v02/loggers/utils.py +86 -0
  39. ads/llm/autogen/v02/runtime_logging.py +163 -0
  40. ads/llm/langchain/plugins/chat_models/oci_data_science.py +12 -11
  41. ads/model/__init__.py +11 -13
  42. ads/model/artifact.py +47 -8
  43. ads/model/extractor/embedding_onnx_extractor.py +80 -0
  44. ads/model/framework/embedding_onnx_model.py +438 -0
  45. ads/model/generic_model.py +26 -24
  46. ads/model/model_metadata.py +8 -7
  47. ads/opctl/config/merger.py +13 -14
  48. ads/opctl/operator/common/operator_config.py +4 -4
  49. ads/opctl/operator/lowcode/common/transformations.py +50 -8
  50. ads/opctl/operator/lowcode/common/utils.py +22 -6
  51. ads/opctl/operator/lowcode/forecast/__main__.py +10 -0
  52. ads/opctl/operator/lowcode/forecast/const.py +2 -0
  53. ads/opctl/operator/lowcode/forecast/model/arima.py +19 -13
  54. ads/opctl/operator/lowcode/forecast/model/automlx.py +129 -36
  55. ads/opctl/operator/lowcode/forecast/model/autots.py +1 -0
  56. ads/opctl/operator/lowcode/forecast/model/base_model.py +61 -14
  57. ads/opctl/operator/lowcode/forecast/model/forecast_datasets.py +1 -1
  58. ads/opctl/operator/lowcode/forecast/model/neuralprophet.py +10 -3
  59. ads/opctl/operator/lowcode/forecast/model/prophet.py +25 -18
  60. ads/opctl/operator/lowcode/forecast/operator_config.py +31 -0
  61. ads/opctl/operator/lowcode/forecast/schema.yaml +76 -0
  62. ads/opctl/operator/lowcode/forecast/utils.py +4 -3
  63. ads/opctl/operator/lowcode/forecast/whatifserve/__init__.py +7 -0
  64. ads/opctl/operator/lowcode/forecast/whatifserve/deployment_manager.py +233 -0
  65. ads/opctl/operator/lowcode/forecast/whatifserve/score.py +238 -0
  66. ads/telemetry/base.py +18 -11
  67. ads/telemetry/client.py +33 -13
  68. ads/templates/schemas/openapi.json +1740 -0
  69. ads/templates/score_embedding_onnx.jinja2 +202 -0
  70. {oracle_ads-2.12.9.dist-info → oracle_ads-2.12.10.dist-info}/METADATA +9 -8
  71. {oracle_ads-2.12.9.dist-info → oracle_ads-2.12.10.dist-info}/RECORD +74 -48
  72. {oracle_ads-2.12.9.dist-info → oracle_ads-2.12.10.dist-info}/LICENSE.txt +0 -0
  73. {oracle_ads-2.12.9.dist-info → oracle_ads-2.12.10.dist-info}/WHEEL +0 -0
  74. {oracle_ads-2.12.9.dist-info → oracle_ads-2.12.10.dist-info}/entry_points.txt +0 -0
ads/aqua/__init__.py CHANGED
@@ -1,12 +1,13 @@
1
1
  #!/usr/bin/env python
2
- # -*- coding: utf-8 -*-
3
- # Copyright (c) 2024 Oracle and/or its affiliates.
2
+ # Copyright (c) 2024, 2025 Oracle and/or its affiliates.
4
3
  # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
5
4
 
6
5
 
7
6
  import os
7
+ from logging import getLogger
8
8
 
9
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
 
@@ -19,6 +20,7 @@ def get_logger_level():
19
20
  return level
20
21
 
21
22
 
23
+ logger = getLogger(__name__)
22
24
  logger.setLevel(get_logger_level())
23
25
 
24
26
 
@@ -27,7 +29,6 @@ def set_log_level(log_level: str):
27
29
 
28
30
  log_level = log_level.upper()
29
31
  logger.setLevel(log_level.upper())
30
- logger.handlers[0].setLevel(log_level)
31
32
 
32
33
 
33
34
  if OCI_RESOURCE_PRINCIPAL_VERSION:
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,44 @@ 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
+ config_path = f"{os.path.dirname(artifact_path)}/config/"
310
+ else:
311
+ logger.info(f"Loading {config_file_name} for model {oci_model.id}...")
312
+ artifact_path = get_artifact_path(oci_model.custom_metadata_list)
313
+ config_path = f"{artifact_path.rstrip('/')}/config/"
314
+
300
315
  if not artifact_path:
301
- logger.error(
316
+ logger.debug(
302
317
  f"Failed to get artifact path from custom metadata for the model: {model_id}"
303
318
  )
304
319
  return config
305
320
 
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
321
+ config_file_path = f"{config_path}{config_file_name}"
322
+ if is_path_exists(config_file_path):
314
323
  try:
315
- config_path = f"{artifact_path.rstrip('/')}/config/"
316
324
  config = load_config(
317
325
  config_path,
318
326
  config_file_name=config_file_name,
319
327
  )
320
328
  except Exception:
321
- pass
329
+ logger.debug(
330
+ f"Error loading the {config_file_name} at path {config_path}.\n"
331
+ f"{traceback.format_exc()}"
332
+ )
322
333
 
323
334
  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."
335
+ logger.debug(
336
+ f"{config_file_name} is not available for the model: {model_id}. "
337
+ f"Check if the custom metadata has the artifact path set."
326
338
  )
327
339
  return config
328
340
 
@@ -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/