CREATE MODEL
Valid in: SQL, ESQL, OpenAPI, ODBC, JDBC, .NET
The CREATE MODEL statement creates a new machine learning model or replaces an existing model.
The CREATE MODEL statement has the following format:
CREATE [OR REPLACE] MODEL model_name
(INPUT SET OF
[(col_name [=] col_type {,col_name[=] col_type})])
[RESULT ROW(col_name col_type {,col_name col_type})]
AS|=
TYPE model_family,
PATH = '/path/to/model/filename'[,] |
[MEMORY = integer[,]] |
[SIGNATURE = 'signature_name'[,]] |
[CREDENTIAL_TYPE =
GCS_SERVICE_1 |
AWS_SIMPLE |
AWS_SESSION |
AZURE_OAUTH2_CLIENT |
AZURE_SHARED_KEY[,]] |
[GCS_EMAIL =
'email',
GCS_PRIVATE_KEY_ID = 'private key',
GCS_PRIVATE_KEY = 'secret key'[,]] |
[AWS_ACCESS_KEY =
'access key',
AWS_SECRET_KEY = 'secret key',
AWS_ENDPOINT = 'endpoint',
AWS_REGION = 'region'[,]
[AWS_SESSION_TOKEN = 'session id'[,]] ] |
[AZURE_CLIENT_ENDPOINT =
'endpoint',
AZURE_CLIENT_ID = 'id',
CREATE OR REPLACE
Creates or recreates the model if it already exists.
model_name
Defines the name of the name.
TYPE
model_family
Specifies the model family, which must be Tensorflow.
PATH
Absolute path to the model. Can be local storage, HDFS, cloud storage (AWS S3, Azure, GCS).
MEMORY
Maximum memory per container. Can be increased for large models if there are out-of-memory errors.
• Default: 512MB
• Minimum 70MB
SIGNATURE
The Tensorflow signature definition, the default is “serving_default”. This is similar to running from the command line:
saved_model_cli show --dir /path/to/model/ --tag_set serve --signature_def serving_default
CREDENTIALS
If necessary, can be specified to access the model storage.
Example query for CREATE MODEL:
CREATE MODEL mymodel(input set of(a float4, b float4))
RESULT ROW (x float4)
AS TYPE tensorflow
PATH = '/path/to/model',
MEMORY = 256000000,
SIGNATURE = 'signature1';\p\g
Last modified date: 12/19/2024