Skip to content

Commit 9b71c2f

Browse files
committed
Adding Content - Importing ONNX Embedding Models 26ai
1 parent 4f0d728 commit 9b71c2f

File tree

7 files changed

+126
-0
lines changed

7 files changed

+126
-0
lines changed

data-platform/data-science/oracle-data-science/RAG-Wikipedia/LICENSE renamed to data-platform/data-science/oracle-vector-search/importing-onnx-embedding-models-26ai/LICENSE

File renamed without changes.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Importing ONNX Embedding Models into Oracle AI Database 26ai
2+
3+
This technical guide describes how to download and import pre-configured and HuggingFace sourced ONNX Embedding Models into the Oracle AI Database 26ai.
4+
5+
Reviewed: 2025.12.11
6+
7+
8+
# When to use this asset?
9+
10+
Use this asset as support material when wanting to download and import pre-configured and HuggingFace sourced ONNX Embedding Models into the Oracle AI Database 26ai.
11+
12+
13+
# How to use this asset?
14+
15+
This asset is provided as general purpose material. Please tailor the content according to your context and needs.
16+
17+
18+
# License
19+
20+
Copyright (c) 2025 Oracle and/or its affiliates.
21+
22+
Licensed under the Universal Permissive License (UPL), Version 1.0.
23+
24+
See [LICENSE](https://github.com/oracle-devrel/technology-engineering/blob/main/LICENSE) for more details.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
wget https://www.python.org/ftp/python/3.12.6/Python/3.12.6.tgz
2+
3+
mkdir -p $HOME/python
4+
5+
tar -xvzf Python-3.12.6.tgz --strip-components=1 -C $HOME/python
6+
7+
sudo yum install libffi-devel openssl openssl-devel tk-devel xz-devel zlib-devel bzip2-devel readline-devel libuuid-devel ncurses-devel libaio
8+
9+
./configure --enable-shared --prefix=$HOME/python
10+
11+
export PYTHONHOME=$HOME/python
12+
13+
export PATH=$PYTHONHOME/bin:$PATH
14+
15+
export LD_LIBRARY_PATH=$PYTHONHOME/lib:$LD_LIBRARY_PATH
16+
17+
cd $HOME/python/bin
18+
19+
ln -s python3.12 python3
20+
21+
ln -s pip3.12 pip3
22+
23+
wget https://download.oracle.com/otn_software/linux/instantclient/2340000/instantclient-basic-linux.x64-23.4.0.24.05.zip
24+
25+
unzip instantclient-basic-linux.x64-23.4.0.24.05.zip
26+
27+
export LD_LIBRARY_PATH=$HOME/instantclient_23_4:$LD_LIBRARY_PATH
28+
29+
vi requirements.txt
30+
31+
pip3 install --upgrade pip
32+
33+
pip3 install -r requirements.txt
34+
35+
scp -i <private-key-file> <location-of-downloaded-zip> opc@<public-ip>:/home/opc
36+
37+
pip3 install client/oml-2.1-cp312-cp312-linux_x86_64.whl
38+
39+
scp -i <private-key-file> <location-of-wallet-file> opc@<public-ip>:/home/opc
40+
41+
mkdir <new-wallet-directory>
42+
43+
unzip <zipped-wallet> -d <new-wallet-directory>
44+
45+
cp <new-wallet-directory>/tnsnames.ora instantclient_23_4/network/admin
46+
47+
Wallet_DataScienceDemosADB
48+
49+
cp <new-wallet-directory>/sqlnet.ora instantclient_23_4/network/admin
50+
51+
cd instantclient_23_4/network/admin
52+
53+
from oml.utils import ONNXPipeline, ONNXPipelineConfig
54+
55+
ONNXPipelineConfig.show_preconfigured()
56+
57+
pipeline = ONNXPipeline(model_name="sentence-transformers/all-MiniLM-L6-v2")
58+
59+
pipeline.export2file("all-MiniLM-L6-v2",output_dir=".")
60+
61+
oml.connect(user="username", password="password",dsn="dsn");
62+
63+
config = ONNXPipelineConfig.from_template("multimodal_clip")
64+
65+
pipeline = ONNXPipeline(model_name="openai/clip-vit-base-patch16", config=config, settings={"ignore_safetensors_error": True})
66+
67+
pipeline.export2file("clip-vit-base-patch16",output_dir=".")
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
Copyright (c) 2025 Oracle and/or its affiliates.
2+
3+
The Universal Permissive License (UPL), Version 1.0
4+
5+
Subject to the condition set forth below, permission is hereby granted to any
6+
person obtaining a copy of this software, associated documentation and/or data
7+
(collectively the "Software"), free of charge and under any and all copyright
8+
rights in the Software, and any and all patent rights owned or freely
9+
licensable by each licensor hereunder covering either (i) the unmodified
10+
Software as contributed to or provided by such licensor, or (ii) the Larger
11+
Works (as defined below), to deal in both
12+
13+
(a) the Software, and
14+
(b) any piece of software and/or hardware listed in the lrgrwrks.txt file if
15+
one is included with the Software (each a "Larger Work" to which the Software
16+
is contributed by such licensors),
17+
18+
without restriction, including without limitation the rights to copy, create
19+
derivative works of, display, perform, and distribute the Software and make,
20+
use, sell, offer for sale, import, export, have made, and have sold the
21+
Software and the Larger Work(s), and to sublicense the foregoing rights on
22+
either these or other terms.
23+
24+
This license is subject to the following condition:
25+
The above copyright notice and either this complete permission notice or at
26+
a minimum a reference to the UPL must be included in all copies or
27+
substantial portions of the Software.
28+
29+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
32+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
34+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
35+
SOFTWARE.

data-platform/data-science/oracle-data-science/RAG-Wikipedia/README.md renamed to data-platform/data-science/oracle-vector-search/python-rag-wikipedia-search/README.md

File renamed without changes.

data-platform/data-science/oracle-data-science/RAG-Wikipedia/files/RAG wikipedia.ipynb renamed to data-platform/data-science/oracle-vector-search/python-rag-wikipedia-search/files/python-rag-wikipedia-search.ipynb

File renamed without changes.

0 commit comments

Comments
 (0)