Skip to contents

Loads a MLM-model for a transformer with the passed type.

Usage

aife_transformer.load_model_mlm(type, model_dir, from_tf, load_safe)

Arguments

type

string A type of the transformer. Allowed types are bert, roberta, funnel, longformer, mpnet, modernbert. See AIFETrType list.

model_dir

string Path to the directory where the original model is stored. Allowed values: any

from_tf

bool Whether to load the model weights from a TensorFlow checkpoint save file.

load_safe

bool Whether or not to use safetensors checkpoints.

Value

If success - a MLM-model, otherwise - an error (passed type is invalid).