def create(
    name: Tag | str,
    *,
    labels: dict[str, t.Any] | None = None,
    metadata: dict[str, t.Any] | None = None,
    _model_store: ModelStore = Provide[BentoMLContainer.model_store],
    module: str = "",  # deprecated
    api_version: str = "v1",  # deprecated
    signatures: ModelSignaturesType = {},  # deprecated
    options: ModelOptions = ModelOptions(),  # deprecated
    custom_objects: dict[str, t.Any] | None = None,  # deprecated
    external_modules: t.List[ModuleType] | None = None,  # deprecated
    context: ModelContext = ModelContext(
        framework_name="", framework_versions={}
    ),  # deprecated
) -> t.Generator[Model, None, None]:
    """
    Create a model instance in BentoML modelstore.

    The following function arguments are deprecated:
        module, api_version, signatures, options, custom_objects, external_modules, context
    """

    res = Model.create(
        name,
        module=module,
        api_version=api_version,
        labels=labels,
        signatures=signatures,
        options=options,
        custom_objects=custom_objects,
        metadata=metadata,
        context=context,
    )
    external_modules = [] if external_modules is None else external_modules
    imported_modules: t.List[ModuleType] = []
    try:
        res.enter_cloudpickle_context(external_modules, imported_modules)
        yield res
    except Exception:
        raise
    else:
        res.flush()
        res.save(_model_store)
        track(
            ModelSaveEvent(
                module=res.info.module,
                model_size_in_kb=calc_dir_size(res.path_of("/")) / 1024,
            ),
        )
    finally:
        res.exit_cloudpickle_context(imported_modules)
Create a model instance in BentoML modelstore.

The following function arguments are deprecated:
module, api_version, signatures, options, custom_objects, external_modules, context
src/bentoml/models.py