Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
2174b36
HF look ahead search
kumar-shivam-ranjan Aug 30, 2024
52077ce
Reverting changes
kumar-shivam-ranjan Aug 30, 2024
833b269
Revert
kumar-shivam-ranjan Aug 30, 2024
83ce1df
HF look ahead search
kumar-shivam-ranjan Aug 30, 2024
611796f
updating filters
kumar-shivam-ranjan Aug 30, 2024
5d5026a
updating doc string
kumar-shivam-ranjan Aug 30, 2024
56abb06
Added the EvaluationServiceConfig class along with supporting structu…
mrDzurb Sep 2, 2024
2821e30
HF look ahead search support in AQUA (#939)
kumar-shivam-ranjan Sep 2, 2024
c55ce22
ODSC-61883: Externalize Supported Metrics List to Service Config
mrDzurb Sep 3, 2024
e5710ba
Enhance the evaluation service config.
mrDzurb Sep 5, 2024
ac541e4
Merge branch 'ODSC-61884/global_evaluation_config' of https://github.…
mrDzurb Sep 5, 2024
44814b4
Adjusts the evaluation metrics config.
mrDzurb Sep 5, 2024
81494c2
Fix override container family (#938)
lu-ohai Sep 5, 2024
9f69f37
ODSC-61986: Get evaluation shapes list form the service config.
mrDzurb Sep 6, 2024
b868f2d
Implement Pass-Through Mechanism for Model Sampling Parameters
mrDzurb Sep 6, 2024
ea10a42
Removes the evaluation inference default parameters from the code.
mrDzurb Sep 6, 2024
bbda290
[AQUA][Evaluate] Externalize Supported Evaluation Metrics List to Ser…
mrDzurb Sep 6, 2024
993f1db
Merge branch 'ODSC-61884/global_evaluation_config' of https://github.…
mrDzurb Sep 6, 2024
9000691
Removes caching from the retrieving evaluation config.
mrDzurb Sep 6, 2024
b0ca718
[AQUA][Evaluate] Externalize Supported Shapes List to Global Config. …
mrDzurb Sep 6, 2024
75fb959
[AQUA][Evaluate] Added the EvaluationServiceConfig class to manage ev…
mrDzurb Sep 9, 2024
9a9569b
Update THIRD_PARTY_LICENSES.txt
mrDzurb Sep 10, 2024
e3de1d0
Fixes evaluation unit tests.
mrDzurb Sep 13, 2024
a76b698
Fixes evaluation unit tests. (#944)
mrDzurb Sep 13, 2024
882a215
added compatibility check
VipulMascarenhas Sep 21, 2024
2a27ef6
add comments and fix tests
VipulMascarenhas Sep 23, 2024
5b4d2d3
Updated compatibility check for aqua (#952)
VipulMascarenhas Sep 23, 2024
c5b5921
sync with main
VipulMascarenhas Sep 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,6 @@ logs/

# Python Wheel
*.whl

# The demo folder
.demo
8 changes: 7 additions & 1 deletion THIRD_PARTY_LICENSES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -459,13 +459,19 @@ mlforecast
* Source code: https://github.com/Nixtla/mlforecast
* Project home: https://github.com/Nixtla/mlforecast

pydantic
* Copyright (c) 2017 to present Pydantic Services Inc. and individual contributors.
* License: The MIT License (MIT)
* Source code: https://github.com/pydantic/pydantic
* Project home: https://docs.pydantic.dev/latest/

rrcf
* Copyright 2018 kLabUM
* License: MIT License
* Source code: https://github.com/kLabUM/rrcf
* Project home: https://github.com/kLabUM/rrcf

=======

=============================== Licenses ===============================
------------------------------------------------------------------------

Expand Down
23 changes: 20 additions & 3 deletions ads/aqua/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
)
from ads.aqua.data import AquaResourceIdentifier
from ads.common.auth import AuthState, default_signer
from ads.common.decorator.threaded import threaded
from ads.common.extended_enum import ExtendedEnumMeta
from ads.common.object_storage_details import ObjectStorageDetails
from ads.common.oci_resource import SEARCH_TYPE, OCIResource
Expand Down Expand Up @@ -225,6 +226,7 @@ def read_file(file_path: str, **kwargs) -> str:
return UNKNOWN


@threaded()
def load_config(file_path: str, config_file_name: str, **kwargs) -> dict:
artifact_path = f"{file_path.rstrip('/')}/{config_file_name}"
signer = default_signer() if artifact_path.startswith("oci://") else {}
Expand Down Expand Up @@ -536,14 +538,14 @@ def _build_job_identifier(
return AquaResourceIdentifier()


def container_config_path():
def service_config_path():
return f"oci://{AQUA_SERVICE_MODELS_BUCKET}@{CONDA_BUCKET_NS}/service_models/config"


@cached(cache=TTLCache(maxsize=1, ttl=timedelta(hours=5), timer=datetime.now))
def get_container_config():
config = load_config(
file_path=container_config_path(),
file_path=service_config_path(),
config_file_name=CONTAINER_INDEX,
)

Expand All @@ -568,7 +570,7 @@ def get_container_image(
"""

config = config_file_name or get_container_config()
config_file_name = container_config_path()
config_file_name = service_config_path()

if container_type not in config:
raise AquaValueError(
Expand Down Expand Up @@ -1062,3 +1064,18 @@ def get_hf_model_info(repo_id: str) -> ModelInfo:
return HfApi().model_info(repo_id=repo_id)
except HfHubHTTPError as err:
raise format_hf_custom_error_message(err) from err


@cached(cache=TTLCache(maxsize=1, ttl=timedelta(hours=5), timer=datetime.now))
def list_hf_models(query: str) -> List[str]:
try:
models = HfApi().list_models(
model_name=query,
task="text-generation",
sort="downloads",
direction=-1,
limit=20,
)
return [model.id for model in models if model.disabled is None]
except HfHubHTTPError as err:
raise format_hf_custom_error_message(err) from err
4 changes: 4 additions & 0 deletions ads/aqua/config/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env python

# Copyright (c) 2024 Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
28 changes: 28 additions & 0 deletions ads/aqua/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,34 @@
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/


from typing import Optional

from ads.aqua.common.entities import ContainerSpec
from ads.aqua.common.utils import get_container_config
from ads.aqua.config.evaluation.evaluation_service_config import EvaluationServiceConfig

DEFAULT_EVALUATION_CONTAINER = "odsc-llm-evaluate"


def get_evaluation_service_config(
container: Optional[str] = DEFAULT_EVALUATION_CONTAINER,
) -> EvaluationServiceConfig:
"""
Retrieves the common evaluation configuration.

Returns
-------
EvaluationServiceConfig: The evaluation common config.
"""

container = container or DEFAULT_EVALUATION_CONTAINER
return EvaluationServiceConfig(
**get_container_config()
.get(ContainerSpec.CONTAINER_SPEC, {})
.get(container, {})
)


# TODO: move this to global config.json in object storage
def get_finetuning_config_defaults():
"""Generate and return the fine-tuning default configuration dictionary."""
Expand Down
4 changes: 4 additions & 0 deletions ads/aqua/config/evaluation/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env python

# Copyright (c) 2024 Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
Loading
Loading