Skip to content

Commit 8df8802

Browse files
committed
Merge branch 'main' of https://github.com/oracle/accelerated-data-science into update_langchain_doc
2 parents 0042f49 + 7e86d16 commit 8df8802

File tree

11 files changed

+271
-87
lines changed

11 files changed

+271
-87
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/llm/serialize.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
from langchain.chains import RetrievalQA
1616
from langchain.chains.loading import load_chain_from_config
1717
from langchain.llms import loading
18-
from langchain.load import dumpd
1918
from langchain.load.load import Reviver
2019
from langchain.load.serializable import Serializable
2120
from langchain.schema.runnable import RunnableParallel

ads/llm/serializers/retrieval_qa.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
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+
17
import base64
28
import json
39
import os
@@ -30,7 +36,7 @@ def load(config: dict, **kwargs):
3036
os.environ.get("OCI_OPENSEARCH_PASSWORD", None),
3137
),
3238
verify_certs=True
33-
if os.environ.get("OCI_OPENSEARCH_VERIFY_CERTS", None).lower() == "true"
39+
if os.environ.get("OCI_OPENSEARCH_VERIFY_CERTS", None) == "True"
3440
else False,
3541
ca_certs=os.environ.get("OCI_OPENSEARCH_CA_CERTS", None),
3642
)
@@ -44,18 +50,18 @@ def save(obj):
4450
serialized["type"] = "constructor"
4551
serialized["_type"] = OpenSearchVectorDBSerializer.type()
4652
kwargs = {}
47-
for key, val in obj.__dict__.items():
48-
if key == "client":
49-
if isinstance(val, OpenSearch):
50-
client_info = val.transport.hosts[0]
53+
for component_name, component in obj.__dict__.items():
54+
if component_name == "client":
55+
if isinstance(component, OpenSearch):
56+
client_info = component.transport.hosts[0]
5157
opensearch_url = (
5258
f"https://{client_info['host']}:{client_info['port']}"
5359
)
5460
kwargs.update({"opensearch_url": opensearch_url})
5561
else:
5662
raise NotImplementedError("Only support OpenSearch client.")
5763
continue
58-
kwargs[key] = dump(val)
64+
kwargs[component_name] = dump(component)
5965
serialized["kwargs"] = kwargs
6066
return serialized
6167

ads/secrets/secrets.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -324,9 +324,7 @@ def __enter__(self, *args, **kwargs):
324324
)
325325
os.environ.update(export_dict)
326326
self.exported_keys = list(export_dict.keys())
327-
logger.debug(
328-
f"Exporting credentials to environment. Keys: {self.exported_keys}"
329-
)
327+
logger.debug(f"Exporting credentials to environment.")
330328
else:
331329
logger.debug(f"Skipping Export credentials to environment.")
332330

docs/source/user_guide/large_language_model/index.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,37 @@
44
Large Language Model
55
####################
66

7+
Oracle Cloud Infrastructure (OCI) provides fully managed infrastructure to work with Large Language Model (LLM).
8+
9+
Train and Deploy LLM
10+
********************
11+
You can train LLM at scale with multi-node and multi-GPU using `Data Science Jobs (Jobs) <https://docs.oracle.com/en-us/iaas/data-science/using/jobs-about.htm>`_, and deploy it with `Data Science Model Deployment (Model Deployments) <https://docs.oracle.com/en-us/iaas/data-science/using/model-dep-about.htm>`_. The following blog posts show examples training and deploying Llama2 models:
12+
13+
* `Multi-GPU multinode fine-tuning Llama2 on OCI Data Science <https://blogs.oracle.com/ai-and-datascience/post/multi-gpu-multi-node-finetuning-llama2-oci>`_
14+
* `Deploy Llama 2 in OCI Data Science <https://blogs.oracle.com/ai-and-datascience/post/llama2-oci-data-science-cloud-platform>`_
15+
* `Quantize and deploy Llama 2 70B on cost-effective NVIDIA A10 Tensor Core GPUs in OCI Data Science <https://blogs.oracle.com/ai-and-datascience/post/quantize-deploy-llama2-70b-costeffective-a10s-oci>`_
16+
17+
18+
Integration with LangChain
19+
**************************
20+
ADS is designed to work with LangChain, enabling developers to incorporate various LangChain components and models deployed on OCI seamlessly into their applications. Additionally, ADS can package LangChain applications and deploy it as a REST API endpoint using OCI Data Science Model Deployment.
21+
22+
23+
.. admonition:: Installation
24+
:class: note
25+
26+
Install ADS and other dependencies for LLM integrations.
27+
28+
.. code-block:: bash
29+
30+
$ python3 -m pip install "oracle-ads[llm]"
31+
32+
733
834
.. toctree::
935
:hidden:
1036
:maxdepth: 2
1137

38+
training_llm
1239
deploy_langchain_application
40+
retrieval

0 commit comments

Comments
 (0)