[][src]Trait rust_bert::Config

pub trait Config<T> where
    T: Deserialize<'de>, 
{ fn from_file(path: &Path) -> T { ... } }

Provided methods

fn from_file(path: &Path) -> T

Loads a Config object from a JSON file. The format is expected to be aligned with the Transformers library configuration files for each model. The parsing will fail if non-optional keys expected by the model are missing.

Arguments

  • path - Path to the configuration JSON file.

Example

use rust_bert::gpt2::Gpt2Config;
use rust_bert::Config;
use std::path::Path;

let config_path = Path::new("path/to/config.json");
let config = Gpt2Config::from_file(config_path);
Loading content...

Implementors

Loading content...