Skip to content

Commit 2ea6b08

Browse files
authored
Merge branch 'feature/forecast_v2' into feature/anomaly_detect
2 parents a0b5e85 + 4afe3c7 commit 2ea6b08

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+5107
-707
lines changed

MANIFEST.in

Lines changed: 9 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,9 @@
1-
include LICENSE.txt
2-
include THIRD_PARTY_LICENSES.txt
3-
include ads/common/*.json
4-
include ads/feature_engineering/*.json
5-
include ads/templates/*.jinja2
6-
include ads/common/function/*.yaml
7-
include ads/common/artifact/*.*
8-
include ads/model/runtime/schemas/*.yaml
9-
include ads/jobs/schema/**
10-
include ads/opctl/index.yaml
11-
include ads/opctl/operators/**/*.py
12-
include ads/opctl/docker/**
13-
include ads/opctl/conda/manifest_template.yaml
14-
include ads/opctl/conda/config.yaml
15-
include ads/opctl/config/diagnostics/**/*.yaml
16-
include ads/opctl/templates/*.jinja2
17-
include pyproject.toml
18-
global-exclude tests/**
19-
global-exclude notebooks/**
20-
exclude tests/**
21-
exclude notebooks/**
22-
exclude build/lib/tests/**
23-
exclude build/lib/notebooks/**
24-
exclude benchmark/**
25-
include ads/ads
26-
include ads/model/common/*.*
27-
include ads/operator/**/*.md
28-
include ads/operator/**/*.yaml
29-
include ads/operator/**/*.whl
30-
include ads/operator/**/MLoperator
1+
# Manifest.in file used by setuptools, which we are not using anymore.
2+
# Do not add anything to this file, unless revert back to setuptools, which is not recommended. See why here:
3+
# https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html.
4+
5+
# Instead flit-core used as backend to build ADS - see section [build-system] in pyproject.toml.
6+
# For flit-core we can specify files and folders, which needs to be included or excluded in build using
7+
# [tool.flit.sdist] section of pyproject.toml. See: https://flit.pypa.io/en/latest/pyproject_toml.html#sdist-section
8+
# If build-system library will change, make changed to list of included/excluded to build files accordingly
9+
# as it will be suggested by new build-system library.

Makefile

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,3 @@
1-
RELEASE_BRANCH := release/ads
2-
DOCS_RELEASE_BRANCH := release
3-
CLONE_DIR := /tmp/advanced-ds
4-
DOCS_CLONE_DIR := /tmp/ads-docs
5-
COPY_INVENTORY := CONTRIBUTING.md LICENSE.txt MANIFEST.in README-development.md README.md SECURITY.md THIRD_PARTY_LICENSES.txt
6-
7-
prepare-release-branch: clean
8-
@git checkout master
9-
@git clean -xdf
10-
@git pull
11-
git checkout -b release/$(RELEASE_VERSION)
12-
13-
prepare-ads:
14-
@echo "Started advanced-ds clone at $$(date)"
15-
@git clone ssh://git@bitbucket.oci.oraclecorp.com:7999/odsc/advanced-ds.git --branch $(RELEASE_BRANCH) --depth 1 $(CLONE_DIR)
16-
@echo "Finished cloning at $$(date)"
17-
cp -r $(CLONE_DIR)/ads .
18-
$(foreach var,$(COPY_INVENTORY),cp $(CLONE_DIR)/$(var) .;)
19-
20-
prepare-docs:
21-
@echo "Started ads_docs clone at $$(date)"
22-
@git clone ssh://git@bitbucket.oci.oraclecorp.com:7999/odsc/ads_docs.git --branch $(DOCS_RELEASE_BRANCH) --depth 1 $(DOCS_CLONE_DIR)
23-
@echo "Finished cloning at $$(date)"
24-
cp -r $(DOCS_CLONE_DIR)/source docs/ && cp $(DOCS_CLONE_DIR)/requirements.txt docs
25-
26-
prepare: prepare-release-branch prepare-ads prepare-docs
27-
28-
push: clean
29-
@bash -c 'if [[ $$(git branch | grep \*) == "* release/$(RELEASE_VERSION)" ]];then echo "Version matching current branch"; else echo "Set proper value to RELEASE_VERSION";exit 1 ; fi'
30-
@git add .
31-
@git commit -m "Release version: $(RELEASE_VERSION)"
32-
@git push --set-upstream origin release/$(RELEASE_VERSION)
33-
341
dist: clean
352
@python3 -m build
363

@@ -43,5 +10,4 @@ clean:
4310
@find ./ -name '*.pyc' -exec rm -f {} \;
4411
@find ./ -name 'Thumbs.db' -exec rm -f {} \;
4512
@find ./ -name '*~' -exec rm -f {} \;
46-
@rm -rf $(CLONE_DIR)
47-
@rm -rf $(DOCS_CLONE_DIR)
13+
@find ./ -name '.DS_Store' -exec rm -f {} \;

THIRD_PARTY_LICENSES.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ docker
5454
* Source code: https://github.com/docker
5555
* Project home: https://www.docker.com/
5656

57+
evaluate
58+
* Copyright 2023 HuggingFace Inc.
59+
* License: Apache-2.0 license
60+
* Source code: https://github.com/huggingface/evaluate
61+
* Project home: https://huggingface.co/docs/evaluate/index
62+
5763
fastavro
5864
* Copyright (c) 2011 Miki Tebeka
5965
* License: MIT License
@@ -133,6 +139,12 @@ jinja2
133139
* Source code: https://github.com/pallets/jinja/
134140
* Project home: https://palletsprojects.com/p/jinja/
135141

142+
langchain
143+
* Copyright (c) 2023 LangChain, Inc.
144+
* License: MIT license
145+
* Source code: https://github.com/langchain-ai/langchain
146+
* Project home: https://www.langchain.com/
147+
136148
lightgbm
137149
* Copyright (c) 2023 Microsoft Corporation
138150
* License: MIT license

ads/common/oci_mixin.py

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
WORK_REQUEST_STOP_STATE = ("SUCCEEDED", "FAILED", "CANCELED")
3434
DEFAULT_WAIT_TIME = 1200
3535
DEFAULT_POLL_INTERVAL = 10
36-
DEFAULT_WORKFLOW_STEPS = 2
36+
WORK_REQUEST_PERCENTAGE = 100
3737

3838

3939
class MergeStrategy(Enum):
@@ -939,7 +939,6 @@ def get_work_request_response(
939939
def wait_for_progress(
940940
self,
941941
work_request_id: str,
942-
num_steps: int = DEFAULT_WORKFLOW_STEPS,
943942
max_wait_time: int = DEFAULT_WAIT_TIME,
944943
poll_interval: int = DEFAULT_POLL_INTERVAL,
945944
):
@@ -949,8 +948,6 @@ def wait_for_progress(
949948
----------
950949
work_request_id: str
951950
Work Request OCID.
952-
num_steps: (int, optional). Defaults to 2.
953-
Number of steps for the progress indicator.
954951
max_wait_time: int
955952
Maximum amount of time to wait in seconds (Defaults to 1200).
956953
Negative implies infinite wait time.
@@ -965,13 +962,14 @@ def wait_for_progress(
965962

966963
i = 0
967964
start_time = time.time()
968-
with get_progress_bar(num_steps) as progress:
965+
with get_progress_bar(WORK_REQUEST_PERCENTAGE) as progress:
969966
seconds_since = time.time() - start_time
970967
exceed_max_time = max_wait_time > 0 and seconds_since >= max_wait_time
971968
if exceed_max_time:
972969
logger.error(f"Max wait time ({max_wait_time} seconds) exceeded.")
970+
previous_percent_complete = 0
973971
while not exceed_max_time and (
974-
not work_request_logs or len(work_request_logs) < num_steps
972+
not work_request_logs or previous_percent_complete <= WORK_REQUEST_PERCENTAGE
975973
):
976974
time.sleep(poll_interval)
977975
new_work_request_logs = []
@@ -988,9 +986,23 @@ def wait_for_progress(
988986
work_request_logs[i:] if work_request_logs else []
989987
)
990988

991-
for wr_item in new_work_request_logs:
992-
progress.update(wr_item.message)
993-
i += 1
989+
percent_change = work_request.percent_complete - previous_percent_complete
990+
previous_percent_complete = work_request.percent_complete
991+
992+
if len(new_work_request_logs) > 0:
993+
start_index = True
994+
for wr_item in new_work_request_logs:
995+
if start_index:
996+
progress.update(wr_item.message, percent_change)
997+
start_index = False
998+
else:
999+
progress.update(wr_item.message, 0)
1000+
i += 1
1001+
else:
1002+
# if there is new percent change but the new work request logs is empty
1003+
# needs to add this percent change to the bar to ensure the final percentage is 100
1004+
if percent_change != 0:
1005+
progress.update(n=percent_change)
9941006

9951007
if work_request and work_request.status in WORK_REQUEST_STOP_STATE:
9961008
if work_request.status != "SUCCEEDED":

ads/llm/__init__.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*--
3+
4+
# Copyright (c) 2023 Oracle and/or its affiliates.
5+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
6+
7+
try:
8+
import langchain
9+
from ads.llm.langchain.plugins.llm_gen_ai import GenerativeAI
10+
from ads.llm.langchain.plugins.llm_md import ModelDeploymentTGI
11+
from ads.llm.langchain.plugins.llm_md import ModelDeploymentVLLM
12+
from ads.llm.langchain.plugins.embeddings import GenerativeAIEmbeddings
13+
except ImportError as ex:
14+
if ex.name == "langchain":
15+
raise ImportError(
16+
f"{ex.msg}\nPlease install/update langchain with `pip install langchain -U`"
17+
) from ex
18+
raise ex

0 commit comments

Comments
 (0)