pyflink.table.table_environment.TableEnvironment.create_model#
- TableEnvironment.create_model(model_path: str, model_descriptor: ModelDescriptor, ignore_if_exists: bool | None = False)[source]#
Registers the given
ModelDescriptoras a catalog model similar to SQL models.The ModelDescriptor is converted into a CatalogModel and stored in the catalog.
If the model should not be permanently stored in a catalog, use
create_temporary_model()instead.Examples:
>>> table_env.create_model("MyModel", ModelDescriptor.for_provider("OPENAI") ... .input_schema(Schema.new_builder() ... .column("f0", DataTypes.STRING()) ... .build()) ... .output_schema(Schema.new_builder() ... .column("label", DataTypes.STRING()) ... .build()) ... .option("task", "regression") ... .option("type", "remote") ... . ... . ... .build(), ... True)
- Parameters:
model_path – The path under which the model will be registered.
model_descriptor – Template for creating a CatalogModel instance.
ignore_if_exists – If a model exists under the given path and this flag is set, no operation is executed. An exception is thrown otherwise.
Added in version 2.1.0.