LOAD_ONNX_MODEL_CLOUD

This procedure enables you to load an ONNX-format embedding model from Oracle Object Storage into your database.

Syntax

DBMS_VECTOR.LOAD_ONNX_MODEL_CLOUD (
     model_name        IN  VARCHAR2,
     credential        IN  VARCHAR2,
     uri               IN  VARCHAR2,
     metadata          IN  JSON DEFAULT JSON('{"function" : "embedding", '||
                              '"embeddingOutput" : "embedding", "input": {"input":["DATA"]}}')
);

Parameters

Table 9 LOAD_ONNX_MODEL_CLOUD Procedure Parameters

Parameter Description
model_name The user-defined name of the model in the form [schema_name.]model_name. This is the name the model will have in OML as a first-class database object. If you do not specify a schema, then your own schema is used.
credential The name of the credential to be used to access Oracle Object Storage.
uri

The URI of the ONNX model.

When the value of uri is a pre-authenticated URI, the credential argument should be passed as NULL.

metadata A JSON description of the metadata describing the model. The metadata at minimum must describe the machine learning function supported by the model. The model’s metadata parameters are described in JSON Metadata Parameters for ONNX Models.

Examples

The following example includes a code snippet that uses the DBMS_VECTOR.LOAD_ONNX_MODEL_CLOUD procedure.

EXECUTE DBMS_VECTOR.LOAD_ONNX_MODEL_CLOUD(
    model_name => 'database',
    credential => 'MYCRED',
    uri => 'https://objectstorage.us-phoenix-1.oraclecloud.com/n/namespace-string/b/bucketname/o/all-MiniLM-L6-v2.onnx',
    metadata => JSON('{"function" : "embedding", "embeddingOutput" : "embedding" , "input": {"input": ["DATA"]}}')
);

Usage Notes

EXECUTE DBMS_VECTOR.LOAD_ONNX_MODEL_CLOUD(
    model_name => 'database',
    credential => 'MYCRED',
    uri => 'https://objectstorage.us-phoenix-1.oraclecloud.com/n/namespace-string/b/bucketname/o/all-MiniLM-L6-v2.onnx'
);