Trait rust_bert::Config [−][src]
pub trait Config<T> where
T: Deserialize<'de>, { fn from_file<P: AsRef<Path>>(path: P) -> T { ... } }
Expand description
Provided methods
fn from_file<P: AsRef<Path>>(path: P) -> T
[src]
Expand description
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);