pub fn from_file<P: AsRef<Path>>(model_type: ModelType, path: P) -> Self {
        match model_type {
            ModelType::Bart => ConfigOption::Bart(BartConfig::from_file(path)),
            ModelType::Bert | ModelType::Roberta | ModelType::XLMRoberta => {
                ConfigOption::Bert(BertConfig::from_file(path))
            }
            ModelType::DistilBert => ConfigOption::DistilBert(DistilBertConfig::from_file(path)),
            ModelType::Electra => ConfigOption::Electra(ElectraConfig::from_file(path)),
            ModelType::Marian => ConfigOption::Marian(BartConfig::from_file(path)),
            ModelType::T5 => ConfigOption::T5(T5Config::from_file(path)),
            ModelType::Albert => ConfigOption::Albert(AlbertConfig::from_file(path)),
        }
    }
/// Interface method to load a configuration from file
Interface method to load a configuration from file
Interface method to load a configuration from file
pub fn from_file<P: AsRef<Path>>(model_type: ModelType, path: P) -> Self {
        match model_type {
            ModelType::Bart => ConfigOption::Bart(BartConfig::from_file(path)),
            ModelType::Bert | ModelType::Roberta | ModelType::XLMRoberta => {
                ConfigOption::Bert(BertConfig::from_file(path))
            }
            ModelType::DistilBert => ConfigOption::DistilBert(DistilBertConfig::from_file(path)),
            ModelType::Electra => ConfigOption::Electra(ElectraConfig::from_file(path)),
            ModelType::Marian => ConfigOption::Marian(BartConfig::from_file(path)),
            ModelType::T5 => ConfigOption::T5(T5Config::from_file(path)),
            ModelType::Albert => ConfigOption::Albert(AlbertConfig::from_file(path)),
        }
    }
pub fn from_file < P : AsRef < Path > > ( model_type : ModelType , path : P ) -> Self { match model_type { ModelType :: Bart => ConfigOption :: Bart ( BartConfig :: from_file ( path ) ) , ModelType :: Bert | ModelType :: Roberta | ModelType :: XLMRoberta => { ConfigOption :: Bert ( BertConfig :: from_file ( path ) ) } ModelType :: DistilBert => ConfigOption :: DistilBert ( DistilBertConfig :: from_file ( path ) ) , ModelType :: Electra => ConfigOption :: Electra ( ElectraConfig :: from_file ( path ) ) , ModelType :: Marian => ConfigOption :: Marian ( BartConfig :: from_file ( path ) ) , ModelType :: T5 => ConfigOption :: T5 ( T5Config :: from_file ( path ) ) , ModelType :: Albert => ConfigOption :: Albert ( AlbertConfig :: from_file ( path ) ) , } }
Interface method to load a configuration from file
Interface method to load a configuration from file
model_type
ModelType
path
P
model_type
ModelType
path
P