[−][src]Trait rust_bert::Config
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::Config; use std::path::Path; use rust_bert::gpt2::Gpt2Config; let config_path = Path::new("path/to/config.json"); let config = Gpt2Config::from_file(config_path);