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.
- ads/aqua/__init__.py +4 -3
- ads/aqua/app.py +28 -16
- ads/aqua/client/__init__.py +3 -0
- ads/aqua/client/client.py +799 -0
- ads/aqua/common/enums.py +3 -0
- ads/aqua/common/utils.py +62 -2
- ads/aqua/data.py +2 -19
- ads/aqua/evaluation/evaluation.py +20 -12
- ads/aqua/extension/aqua_ws_msg_handler.py +14 -7
- ads/aqua/extension/base_handler.py +12 -9
- ads/aqua/extension/finetune_handler.py +8 -14
- ads/aqua/extension/model_handler.py +24 -2
- ads/aqua/finetuning/constants.py +5 -2
- ads/aqua/finetuning/entities.py +67 -17
- ads/aqua/finetuning/finetuning.py +69 -54
- ads/aqua/model/entities.py +3 -1
- ads/aqua/model/model.py +196 -98
- ads/aqua/modeldeployment/deployment.py +22 -10
- ads/cli.py +16 -8
- ads/common/auth.py +9 -9
- ads/llm/autogen/__init__.py +2 -0
- ads/llm/autogen/constants.py +15 -0
- ads/llm/autogen/reports/__init__.py +2 -0
- ads/llm/autogen/reports/base.py +67 -0
- ads/llm/autogen/reports/data.py +103 -0
- ads/llm/autogen/reports/session.py +526 -0
- ads/llm/autogen/reports/templates/chat_box.html +13 -0
- ads/llm/autogen/reports/templates/chat_box_lt.html +5 -0
- ads/llm/autogen/reports/templates/chat_box_rt.html +6 -0
- ads/llm/autogen/reports/utils.py +56 -0
- ads/llm/autogen/v02/__init__.py +4 -0
- ads/llm/autogen/{client_v02.py → v02/client.py} +23 -10
- ads/llm/autogen/v02/log_handlers/__init__.py +2 -0
- ads/llm/autogen/v02/log_handlers/oci_file_handler.py +83 -0
- ads/llm/autogen/v02/loggers/__init__.py +6 -0
- ads/llm/autogen/v02/loggers/metric_logger.py +320 -0
- ads/llm/autogen/v02/loggers/session_logger.py +580 -0
- ads/llm/autogen/v02/loggers/utils.py +86 -0
- ads/llm/autogen/v02/runtime_logging.py +163 -0
- ads/llm/langchain/plugins/chat_models/oci_data_science.py +12 -11
- ads/model/__init__.py +11 -13
- ads/model/artifact.py +47 -8
- ads/model/extractor/embedding_onnx_extractor.py +80 -0
- ads/model/framework/embedding_onnx_model.py +438 -0
- ads/model/generic_model.py +26 -24
- ads/model/model_metadata.py +8 -7
- ads/opctl/config/merger.py +13 -14
- ads/opctl/operator/common/operator_config.py +4 -4
- ads/opctl/operator/lowcode/common/transformations.py +50 -8
- ads/opctl/operator/lowcode/common/utils.py +22 -6
- ads/opctl/operator/lowcode/forecast/__main__.py +10 -0
- ads/opctl/operator/lowcode/forecast/const.py +2 -0
- ads/opctl/operator/lowcode/forecast/model/arima.py +19 -13
- ads/opctl/operator/lowcode/forecast/model/automlx.py +129 -36
- ads/opctl/operator/lowcode/forecast/model/autots.py +1 -0
- ads/opctl/operator/lowcode/forecast/model/base_model.py +61 -14
- ads/opctl/operator/lowcode/forecast/model/forecast_datasets.py +1 -1
- ads/opctl/operator/lowcode/forecast/model/neuralprophet.py +10 -3
- ads/opctl/operator/lowcode/forecast/model/prophet.py +25 -18
- ads/opctl/operator/lowcode/forecast/operator_config.py +31 -0
- ads/opctl/operator/lowcode/forecast/schema.yaml +76 -0
- ads/opctl/operator/lowcode/forecast/utils.py +4 -3
- ads/opctl/operator/lowcode/forecast/whatifserve/__init__.py +7 -0
- ads/opctl/operator/lowcode/forecast/whatifserve/deployment_manager.py +233 -0
- ads/opctl/operator/lowcode/forecast/whatifserve/score.py +238 -0
- ads/telemetry/base.py +18 -11
- ads/telemetry/client.py +33 -13
- ads/templates/schemas/openapi.json +1740 -0
- ads/templates/score_embedding_onnx.jinja2 +202 -0
- {oracle_ads-2.12.9.dist-info → oracle_ads-2.12.10.dist-info}/METADATA +9 -8
- {oracle_ads-2.12.9.dist-info → oracle_ads-2.12.10.dist-info}/RECORD +74 -48
- {oracle_ads-2.12.9.dist-info → oracle_ads-2.12.10.dist-info}/LICENSE.txt +0 -0
- {oracle_ads-2.12.9.dist-info → oracle_ads-2.12.10.dist-info}/WHEEL +0 -0
- {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
|
-
#
|
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
|
-
|
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.
|
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
|
-
|
307
|
-
|
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
|
-
|
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.
|
325
|
-
f"{config_file_name} is not available for the model: {model_id}.
|
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
|
|