Oracle Databaseの準備
OML4Pyサーバーとクライアントの構成
docker cp oml4py-client-linux-x86_64-2.1.1.zip local-26ai:/home/oracle
docker cp config_oml4py_211.sh local-26ai:/home/oracleoml4py % docker cp oml4py-client-linux-x86_64-2.1.1.zip local-26ai:/home/oracle
Successfully copied 30.4MB to local-26ai:/home/oracle
oml4py % docker cp config_oml4py_211.sh local-26ai:/home/oracle
Successfully copied 8.7kB to local-26ai:/home/oracle
oml4py %
docker exec local-26ai sh ./config_oml4py_211.shoml4py % docker exec local-26ai sh ./config_oml4py_211.sh
The Oracle base remains unchanged with value /opt/oracle
Oracle Linux 8 BaseOS Latest (x86_64) 8.0 MB/s | 131 MB 00:16
Oracle Linux 8 Application Stream (x86_64) 8.4 MB/s | 78 MB 00:09
Oracle Linux 8 Development Packages (x86_64) 8.6 MB/s | 264 MB 00:30
Last metadata expiration check: 0:00:19 ago on Mon Feb 16 03:56:00 2026.
Package openssl-1:1.1.1k-14.el8_10.x86_64 is already installed.
Dependencies resolved.
=======================================================================================================
Package Arch Version Repository Size
=======================================================================================================
Installing:
bzip2-devel x86_64 1.0.6-28.el8_10 ol8_baseos_latest 224 k
gcc x86_64 8.5.0-28.0.1.el8_10 ol8_appstream 24 M
libffi-devel x86_64 3.1-24.el8 ol8_baseos_latest 29 k
libuuid-devel x86_64 2.32.1-48.0.1.el8_10 ol8_baseos_latest 99 k
ncurses-devel x86_64 6.1-10.20180224.el8 ol8_baseos_latest 528 k
openblas x86_64 0.3.15-6.el8 ol8_appstream 5.0 M
[中略]
Installing collected packages: oml
Successfully installed oml-2.1.1
Oracle Machine Learning for Python 2.1.1 Client.
Copyright (c) 2018, 2026 Oracle and/or its affiliates. All rights reserved.
Checking platform .................. Pass
Checking Python .................... Pass
Checking dependencies .............. Pass
Checking OML4P version ............. Pass
Current configuration
Python Version ................... 3.13.5
PYTHONHOME ....................... /home/oracle/python
Existing OML4P module version .... 2.1.1
Operation ........................ Install/Upgrade
Found existing installation: oml 2.1.1
Uninstalling oml-2.1.1:
Successfully uninstalled oml-2.1.1
Processing ./client/oml-2.1.1-cp313-cp313-linux_x86_64.whl
Installing collected packages: oml
Successfully installed oml-2.1.1
Done
oml4py %
構成スクリプトが正常に終了すると、OML4Pyのサーバーとクライアントの構成は完了です。
以下は、OML4Pyサーバーとクライアントの検証を行なうスクリプトです。
docker cp verify_oml4py_211.sh local-26ai:/home/oracle
docker exec local-26ai sh ./verify_oml4py_211.sh [ユーザーOML_USERに設定するパスワード]
oml4py % docker cp verify_oml4py_211.sh local-26ai:/home/oracle
Successfully copied 4.61kB to local-26ai:/home/oracle
oml4py % docker exec local-26ai sh ./verify_oml4py_211.sh *********
SQL*Plus: Release 23.26.1.0.0 - Production on Tue Feb 17 01:13:48 2026
Version 23.26.1.0.0
Copyright (c) 1982, 2025, Oracle. All rights reserved.
Connected to:
Oracle AI Database 26ai Free Release 23.26.1.0.0 - Develop, Learn, and Run for Free
Version 23.26.1.0.0
SQL>
Session altered.
SQL>
Session altered.
Enter value for password: old 1: create user &&1 identified by &password
new 1: create user oml_user identified by oracle
old 2: default tablespace &&2
new 2: default tablespace USERS
old 3: temporary tablespace &&3
new 3: temporary tablespace TEMP
old 4: quota &&4 on &&2
new 4: quota unlimited on USERS
User created.
old 4: 'create procedure, create mining model to &&1';
new 4: 'create procedure, create mining model to oml_user';
old 6: IF lower('&&5') = 'pyqadmin' THEN
new 6: IF lower('pyqadmin') = 'pyqadmin' THEN
old 7: execute immediate 'grant PYQADMIN to &&1';
new 7: execute immediate 'grant PYQADMIN to oml_user';
PL/SQL procedure successfully completed.
Session altered.
SQL> Disconnected from Oracle AI Database 26ai Free Release 23.26.1.0.0 - Develop, Learn, and Run for Free
Version 23.26.1.0.0
SQL*Plus: Release 23.26.1.0.0 - Production on Tue Feb 17 01:13:48 2026
Version 23.26.1.0.0
Copyright (c) 1982, 2025, Oracle. All rights reserved.
Connected to:
Oracle AI Database 26ai Free Release 23.26.1.0.0 - Develop, Learn, and Run for Free
Version 23.26.1.0.0
SQL> SQL> SQL> SQL>
NAME VALUE
------------ ------------------------------------------------------------
PYTHONHOME /opt/oracle/product/26ai/dbhomeFree/python
PYTHONPATH /opt/oracle/product/26ai/dbhomeFree/oml4py/modules
VERSION 2.0
PLATFORM ODB
DSWLIST oml.*;pandas.*;numpy.*;matplotlib.*;sklearn.*
SQL> Disconnected from Oracle AI Database 26ai Free Release 23.26.1.0.0 - Develop, Learn, and Run for Free
Version 23.26.1.0.0
# Verify the Package Installation for OML4Py Server.
import numpy
import pandas
import scipy
import matplotlib
import oracledb
import sklearn
# Verify Database Connection.
import sys
import oml
oml.connect(user='oml_user',password=sys.argv[1],port=1521,host='localhost',service_name='freepdb1')
# Run Python script
oml.script.create("TEST", func='def func():return 1 + 1', overwrite=True)
res = oml.do_eval(func='TEST')
print(res)
oml.script.drop("TEST")
2
# Verify the Package Installation for OML4Py Client.
import numpy
import pandas
import scipy
import matplotlib
import oracledb
import sklearn
import onnx
import torch
import onnxruntime_extensions
import transformers
import sentencepiece
# Verify Database Connection.
import sys
import oml
import warnings
import torch
warnings.filterwarnings("ignore", category=DeprecationWarning)
warnings.filterwarnings("ignore", category=torch.jit.TracerWarning)
oml.__version__
oml.__path__
oml.connect(user='oml_user',password=sys.argv[1],port=1521,host='localhost',service_name='freepdb1')
# Run Python script
from oml.utils import ONNXPipeline, ONNXPipelineConfig
ONNXPipelineConfig.show_preconfigured()
ONNXPipelineConfig.show_templates()
pipeline = ONNXPipeline(model_name="sentence-transformers/all-MiniLM-L6-v2")
pipeline.export2file("all-MiniLM-L6-v2",output_dir=".")
-rw-r--r-- 1 oracle oinstall 90615981 Feb 17 01:14 all-MiniLM-L6-v2.onnx
oml4py %
データベース・ユーザーOML_USERの作成
docker exec -it local-26ai bashoml4py % docker exec -it local-26ai bash
bash-4.4$
cd $ORACLE_HOME/oml4py/server
sqlplus / as sysdba
alter session set container=FREEPDB1;
@pyquser.sql oml_user USERS TEMP unlimited pyqadmin
exitbash-4.4$ cd $ORACLE_HOME/oml4py/server
bash-4.4$ sqlplus / as sysdba
SQL*Plus: Release 23.26.1.0.0 - Production on Mon Feb 16 05:27:10 2026
Version 23.26.1.0.0
Copyright (c) 1982, 2025, Oracle. All rights reserved.
Connected to:
Oracle AI Database 26ai Free Release 23.26.1.0.0 - Develop, Learn, and Run for Free
Version 23.26.1.0.0
SQL> alter session set container=FREEPDB1;
Session altered.
SQL> @pyquser.sql oml_user USERS TEMP unlimited pyqadmin
Session altered.
Enter value for password: ********
old 1: create user &&1 identified by &password
new 1: create user oml_user identified by oracle
old 2: default tablespace &&2
new 2: default tablespace USERS
old 3: temporary tablespace &&3
new 3: temporary tablespace TEMP
old 4: quota &&4 on &&2
new 4: quota unlimited on USERS
User created.
old 4: 'create procedure, create mining model to &&1';
new 4: 'create procedure, create mining model to oml_user';
old 6: IF lower('&&5') = 'pyqadmin' THEN
new 6: IF lower('pyqadmin') = 'pyqadmin' THEN
old 7: execute immediate 'grant PYQADMIN to &&1';
new 7: execute immediate 'grant PYQADMIN to oml_user';
PL/SQL procedure successfully completed.
Session altered.
SQL> exit
Disconnected from Oracle AI Database 26ai Free Release 23.26.1.0.0 - Develop, Learn, and Run for Free
Version 23.26.1.0.0
bash-4.4$
sqlplus oml_user@localhost/freepdb1
set trim on trims on
col name format a12
col value format a60
select * from sys.pyq_config;
exitbash-4.4$ sqlplus oml_user@localhost/freepdb1
SQL*Plus: Release 23.26.1.0.0 - Production on Mon Feb 16 05:29:36 2026
Version 23.26.1.0.0
Copyright (c) 1982, 2025, Oracle. All rights reserved.
Enter password: ********
Connected to:
Oracle AI Database 26ai Free Release 23.26.1.0.0 - Develop, Learn, and Run for Free
Version 23.26.1.0.0
SQL> set trim on trims on
SQL> col name format a12
SQL> col value format a60
SQL> select * from sys.pyq_config;
NAME VALUE
------------ ------------------------------------------------------------
PYTHONHOME /opt/oracle/product/26ai/dbhomeFree/python
PYTHONPATH /opt/oracle/product/26ai/dbhomeFree/oml4py/modules
VERSION 2.0
PLATFORM ODB
DSWLIST oml.*;pandas.*;numpy.*;matplotlib.*;sklearn.*
SQL> exit
Disconnected from Oracle AI Database 26ai Free Release 23.26.1.0.0 - Develop, Learn, and Run for Free
Version 23.26.1.0.0
bash-4.4$
OML4Pyサーバーの動作確認
docker exec -it local-26ai bashoml4py % docker exec -it local-26ai bash
bash-4.4$
export ORAENV_ASK=NO
export ORACLE_SID=FREE
export PYTHONHOME=$ORACLE_HOME/python
export PATH=$PYTHONHOME/bin:$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$PYTHONHOME/lib:$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export PYTHONPATH=$ORACLE_HOME/oml4py/modules
bash-4.4$ export ORAENV_ASK=NO
bash-4.4$ export ORACLE_SID=FREE
bash-4.4$ export PYTHONHOME=$ORACLE_HOME/python
bash-4.4$ export PATH=$PYTHONHOME/bin:$ORACLE_HOME/bin:$PATH
bash-4.4$ export LD_LIBRARY_PATH=$PYTHONHOME/lib:$ORACLE_HOME/lib:$LD_LIBRARY_PATH
bash-4.4$ export PYTHONPATH=$ORACLE_HOME/oml4py/modules
bash-4.4$
bash-4.4$ export PYTHONPATH=$ORACLE_HOME/oml4py/modules
bash-4.4$ python3
Python 3.13.11 (main, Dec 18 2025, 09:01:31) [GCC 8.5.0 20210514 (Red Hat 8.5.0-26.0.1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
import numpy
import pandas
import scipy
import matplotlib
import oracledb
import sklearn
>>> import numpy
>>> import pandas
>>> import scipy
>>> import matplotlib
>>> import oracledb
>>> import sklearn
>>>
import oml
oml.connect(user='oml_user',password='********',port=1521,host='localhost',service_name='freepdb1')
>>> import oml
>>> oml.connect(user='oml_user',password='******',port=1521,host='localhost',service_name='freepdb1')
>>>
oml.script.create("TEST", func='def func():return 1 + 1', overwrite=True)>>> oml.script.create("TEST", func='def func():return 1 + 1', overwrite=True)
>>>
res = oml.do_eval(func='TEST')
res
>>> res = oml.do_eval(func='TEST')
>>> res
2
>>>
oml.script.drop("TEST")>>> oml.script.drop("TEST")
>>>
bash-4.4$
OML4Pyクライアントの動作確認
export PYTHONHOME=$HOME/python
export PATH=$PYTHONHOME/bin:$PATH
export LD_LIBRARY_PATH=$PYTHONHOME/lib:$LD_LIBRARY_PATH
unset PYTHONPATHbash-4.4$ export PYTHONHOME=$HOME/python
bash-4.4$ export PATH=$PYTHONHOME/bin:$PATH
bash-4.4$ export LD_LIBRARY_PATH=$PYTHONHOME/lib:$LD_LIBRARY_PATH
bash-4.4$ unset PYTHONPATH
bash-4.4$ python3
Python 3.13.5 (main, Feb 16 2026, 06:05:41) [GCC 8.5.0 20210514 (Red Hat 8.5.0-28.0.1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
import numpy
import pandas
import scipy
import matplotlib
import oracledb
import sklearn
import onnx
import torch
import onnxruntime_extensions
import transformers
import sentencepiece
>>> import numpy
>>> import pandas
>>> import scipy
>>> import matplotlib
>>> import oracledb
>>> import sklearn
>>> import onnx
>>> import torch
>>> import onnxruntime_extensions
>>> import transformers
>>> import sentencepiece
>>>
import oml
oml.__version__
oml.__path__
oml.connect(user='oml_user',password='*********',port=1521,host='localhost',service_name='freepdb1')>>> import oml
>>> oml.__version__
'2.1.1'
>>> oml.__path__
['/home/oracle/python/lib/python3.13/site-packages/oml']
>>> oml.connect(user='oml_user',password='oracle',port=1521,host='localhost',service_name='freepdb1')
>>>
ONNX Pipeline Models : Text Embedding
https://docs.oracle.com/en/database/oracle/oracle-database/26/vecse/onnx-pipeline-models-text-embedding.html
python3を起動し、データベースに接続したところから作業を始めます。
from oml.utils import ONNXPipeline, ONNXPipelineConfig
ONNXPipelineConfig.show_preconfigured()
ONNXPipelineConfig.show_templates()
pipeline = ONNXPipeline(model_name="sentence-transformers/all-MiniLM-L6-v2")
pipeline.export2file("all-MiniLM-L6-v2",output_dir=".")
>>> import oml
>>> oml.__version__
'2.1.1'
>>> oml.__path__
['/home/oracle/python/lib/python3.13/site-packages/oml']
>>> oml.connect(user='oml_user',password='oracle',port=1521,host='localhost',service_name='freepdb1')
>>> from oml.utils import ONNXPipeline, ONNXPipelineConfig
>>> ONNXPipelineConfig.show_preconfigured()
['sentence-transformers/all-mpnet-base-v2', 'sentence-transformers/all-MiniLM-L6-v2', 'sentence-transformers/multi-qa-MiniLM-L6-cos-v1', 'sentence-transformers/distiluse-base-multilingual-cased-v2', 'sentence-transformers/all-MiniLM-L12-v2', 'BAAI/bge-small-en-v1.5', 'BAAI/bge-base-en-v1.5', 'taylorAI/bge-micro-v2', 'intfloat/e5-small-v2', 'intfloat/e5-base-v2', 'thenlper/gte-base', 'thenlper/gte-small', 'TaylorAI/gte-tiny', 'sentence-transformers/paraphrase-multilingual-mpnet-base-v2', 'intfloat/multilingual-e5-base', 'intfloat/multilingual-e5-small', 'sentence-transformers/stsb-xlm-r-multilingual', 'Snowflake/snowflake-arctic-embed-xs', 'Snowflake/snowflake-arctic-embed-s', 'Snowflake/snowflake-arctic-embed-m', 'mixedbread-ai/mxbai-embed-large-v1', 'openai/clip-vit-large-patch14', 'google/vit-base-patch16-224', 'microsoft/resnet-18', 'microsoft/resnet-50', 'WinKawaks/vit-tiny-patch16-224', 'Falconsai/nsfw_image_detection', 'WinKawaks/vit-small-patch16-224', 'nateraw/vit-age-classifier', 'rizvandwiki/gender-classification', 'AdamCodd/vit-base-nsfw-detector', 'trpakov/vit-face-expression', 'BAAI/bge-reranker-base', 'BAAI/bge-large-en-v1.5', 'ibm-granite/granite-embedding-278m-multilingual', 'thenlper/gte-large', 'Snowflake/snowflake-arctic-embed-l', 'WhereIsAI/UAE-Large-V1']
>>> ONNXPipelineConfig.show_templates()
['image_convnext', 'image_vit', 'text', 'multimodal_clip']
>>> pipeline = ONNXPipeline(model_name="sentence-transformers/all-MiniLM-L6-v2")
>>> pipeline.export2file("all-MiniLM-L6-v2",output_dir=".")
tokenizer_config.json: 100%|██████████████████████████████████████████████| 350/350 [00:00<00:00, 1.29MB/s]
vocab.txt: 232kB [00:00, 9.25MB/s]
special_tokens_map.json: 100%|█████████████████████████████████████████████| 112/112 [00:00<00:00, 479kB/s]
tokenizer.json: 466kB [00:00, 17.0MB/s]
config.json: 100%|████████████████████████████████████████████████████████| 612/612 [00:00<00:00, 2.59MB/s]
model.safetensors: 100%|██████████████████████████████████████████████| 90.9M/90.9M [00:12<00:00, 7.42MB/s]
<python-input-8>:1: DeprecationWarning: You are using the legacy TorchScript-based ONNX export. Starting in PyTorch 2.9, the new torch.export-based ONNX exporter will be the default. To switch now, set dynamo=True in torch.onnx.export. This new exporter supports features like exporting LLMs with DynamicCache. We encourage you to try it and share feedback to help improve the experience. Learn more about the new export logic: https://pytorch.org/docs/stable/onnx_dynamo.html. For exporting control flow: https://pytorch.org/tutorials/beginner/onnx/export_control_flow_model_to_onnx_tutorial.html.
/home/oracle/python/lib/python3.13/site-packages/transformers/modeling_attn_mask_utils.py:196: TracerWarning: torch.tensor results are registered as constants in the trace. You can safely ignore this warning if you use this function to create tensors out of constant variables that would be the same every time you call this function. In any other case, this might cause the trace to be incorrect.
inverted_mask = torch.tensor(1.0, dtype=dtype) - expanded_mask
>>>
bash-4.4$
import warnings
import torch
warnings.filterwarnings("ignore", category=DeprecationWarning)
warnings.filterwarnings("ignore", category=torch.jit.TracerWarning)
>>> import warnings
>>> import torch
>>> warnings.filterwarnings("ignore", category=DeprecationWarning)
>>> warnings.filterwarnings("ignore", category=torch.jit.TracerWarning)
>>>
cd
lsbash-4.4$ cd
bash-4.4$ ls
Python-3.13.5.tgz config_oml4py_211.sh requirements.txt
all-MiniLM-L6-v2.onnx oml4py-client-linux-x86_64-2.1.1.zip requirements2.txt
client python setPassword.sh
bash-4.4$
sqlplus / as sysdba
alter session set container=FREEPDB1;bash-4.4$ sqlplus / as sysdba
SQL*Plus: Release 23.26.1.0.0 - Production on Mon Feb 16 06:25:04 2026
Version 23.26.1.0.0
Copyright (c) 1982, 2025, Oracle. All rights reserved.
Connected to:
Oracle AI Database 26ai Free Release 23.26.1.0.0 - Develop, Learn, and Run for Free
Version 23.26.1.0.0
SQL> alter session set container=FREEPDB1;
Session altered.
SQL>
create or replace directory ONNX_IMPORT as '/home/oracle';
grant read, write on directory onnx_import to oml_user;
grant create mining model to oml_user;SQL> create or replace directory ONNX_IMPORT as '/home/oracle';
Directory created.
SQL> grant read, write on directory onnx_import to oml_user;
Grant succeeded.
SQL> grant create mining model to oml_user;
Grant succeeded.
SQL> exit
Disconnected from Oracle AI Database 26ai Free Release 23.26.1.0.0 - Develop, Learn, and Run for Free
Version 23.26.1.0.0
bash-4.4$
sqlplus oml_user@localhost/freepdb1bash-4.4$ sqlplus oml_user@localhost/freepdb1
SQL*Plus: Release 23.26.1.0.0 - Production on Mon Feb 16 06:27:44 2026
Version 23.26.1.0.0
Copyright (c) 1982, 2025, Oracle. All rights reserved.
Enter password: ********
Last Successful login time: Mon Feb 16 2026 06:18:38 +00:00
Connected to:
Oracle AI Database 26ai Free Release 23.26.1.0.0 - Develop, Learn, and Run for Free
Version 23.26.1.0.0
SQL>
begin
dbms_vector.load_onnx_model(
directory => 'ONNX_IMPORT'
,file_name => 'all-MiniLM-L6-v2.onnx'
,model_name => 'ALL_MINILM_L6_V2'
);
end;
/
SQL> begin
dbms_vector.load_onnx_model(
directory => 'ONNX_IMPORT'
,file_name => 'all-MiniLM-L6-v2.onnx'
,model_name => 'ALL_MINILM_L6_V2'
);
end;
/ 2 3 4 5 6 7 8
PL/SQL procedure successfully completed.
SQL>
ビューUSER_MINING_MODELSから、データベースにロードされたモデルを確認します。
col model_name format a16
col algorithm format a20
select MODEL_NAME, ALGORITHM from user_mining_models;SQL> col model_name format a16
SQL> col algorithm format a20
SQL> select MODEL_NAME, ALGORITHM from user_mining_models;
MODEL_NAME ALGORITHM
---------------- --------------------
ALL_MINILM_L6_V2 ONNX
SQL>
select vector_embedding(ALL_MINILM_L6_V2 using 'test' as data);SQL> select vector_embedding(ALL_MINILM_L6_V2 using 'test' as data);
VECTOR_EMBEDDING(ALL_MINILM_L6_V2USING'TEST'ASDATA)
--------------------------------------------------------------------------------
[1.15733938E-002,2.51362529E-002,-3.67018655E-002,5.93249127E-002,
SQL>
以上ですべての作業は完了です。
SQL> exit
Disconnected from Oracle AI Database 26ai Free Release 23.26.1.0.0 - Develop, Learn, and Run for Free
Version 23.26.1.0.0
bash-4.4$
sqlplus / as sysdba
alter session set container=FREEPDB1;bash-4.4$ sqlplus / as sysdba
SQL*Plus: Release 23.26.0.0.0 - Production on Mon Feb 16 08:12:05 2026
Version 23.26.0.0.0
Copyright (c) 1982, 2025, Oracle. All rights reserved.
Connected to:
Oracle AI Database 26ai Free Release 23.26.0.0.0 - Develop, Learn, and Run for Free
Version 23.26.0.0.0
SQL> alter session set container=FREEPDB1;
Session altered.
SQL>
create user oml_user identified by ******** default tablespace users temporary tablespace temp;
alter user oml_user quota unlimited on users;
grant create session, create table, create view, create procedure, create mining model to oml_user;
grant execute on ctxsys.ctx_ddl to oml_user;SQL> create user oml_user identified by ******** default tablespace users temporary tablespace temp;
User created.
SQL> alter user oml_user quota unlimited on users;
User altered.
SQL> grant create session, create table, create view, create procedure, create mining model to oml_user;
Grant succeeded.
SQL> grant execute on ctxsys.ctx_ddl to oml_user;
Grant succeeded.
SQL>
create or replace directory onnx_import as '/home/oracle';
grant read, write on directory onnx_import to oml_user;SQL> create or replace directory onnx_import as '/home/oracle';
Directory created.
SQL> grant read, write on directory onnx_import to oml_user;
Grant succeeded.
SQL> exit
Disconnected from Oracle AI Database 26ai Free Release 23.26.0.0.0 - Develop, Learn, and Run for Free
Version 23.26.0.0.0
bash-4.4$
sqlplus oml_user@localhost/freepdb1bash-4.4$ sqlplus oml_user@localhost/freepdb1
SQL*Plus: Release 23.26.0.0.0 - Production on Mon Feb 16 08:16:49 2026
Version 23.26.0.0.0
Copyright (c) 1982, 2025, Oracle. All rights reserved.
Enter password: ********
Connected to:
Oracle AI Database 26ai Free Release 23.26.0.0.0 - Develop, Learn, and Run for Free
Version 23.26.0.0.0
SQL>
begin
dbms_vector.load_onnx_model(
directory => 'ONNX_IMPORT'
,file_name => 'all-MiniLM-L6-v2.onnx'
,model_name => 'ALL_MINILM_L6_V2'
);
end;
/
col model_name format a16
col algorithm format a20
select MODEL_NAME, ALGORITHM from user_mining_models;
select vector_embedding(ALL_MINILM_L6_V2 using 'test' as data);SQL> begin
dbms_vector.load_onnx_model(
directory => 'ONNX_IMPORT'
,file_name => 'all-MiniLM-L6-v2.onnx'
,model_name => 'ALL_MINILM_L6_V2'
);
end;
/ 2 3 4 5 6 7 8
PL/SQL procedure successfully completed.
SQL> col model_name format a16
SQL> col algorithm format a20
SQL> select MODEL_NAME, ALGORITHM from user_mining_models;
MODEL_NAME ALGORITHM
---------------- --------------------
ALL_MINILM_L6_V2 ONNX
SQL> select vector_embedding(ALL_MINILM_L6_V2 using 'test' as data);
VECTOR_EMBEDDING(ALL_MINILM_L6_V2USING'TEST'ASDATA)
--------------------------------------------------------------------------------
[1.15733724E-002,2.51362175E-002,-3.6701858E-002,5.93249165E-002,
SQL>
