pub fn new<'p, P>(p: P, config: &BartConfig) -> BartForSequenceClassification
    where
        P: Borrow<nn::Path<'p>>,
    {
        let p = p.borrow();

        let base_model = BartModel::new(p / "model", config, false);
        let classification_head = BartClassificationHead::new(p / "classification_head", config);
        let eos_token_id = match config.eos_token_id {
            Some(value) => value,
            None => 3,
        };
        BartForSequenceClassification {
            base_model,
            classification_head,
            eos_token_id,
        }
    }
/// Build a new `BartForSequenceClassification`
///
/// # Arguments
///
/// * `p` - Variable store path for the root of the BART model
/// * `config` - `BartConfig` object defining the model architecture
///
/// # Example
///
/// ```no_run
/// use rust_bert::bart::{BartConfig, BartForSequenceClassification};
/// use rust_bert::Config;
/// use std::path::Path;
/// use tch::{nn, Device};
///
/// let config_path = Path::new("path/to/config.json");
/// let device = Device::Cpu;
/// let p = nn::VarStore::new(device);
/// let config = BartConfig::from_file(config_path);
/// let generation_mode = true;
/// let bart: BartForSequenceClassification =
///     BartForSequenceClassification::new(&p.root() / "bart", &config);
/// ```
Build a new `BartForSequenceClassification`
Build a new ` BartForSequenceClassification `
pub fn new<'p, P>(p: P, config: &BartConfig) -> BartForSequenceClassification
    where
        P: Borrow<nn::Path<'p>>,
    {
        let p = p.borrow();
        let base_model = BartModel::new(p / "model", config, false);
        let classification_head = BartClassificationHead::new(p / "classification_head", config);
        let eos_token_id = match config.eos_token_id {
            Some(value) => value,
            None => 3,
        };
        BartForSequenceClassification {
            base_model,
            classification_head,
            eos_token_id,
        }
    }
pub fn new < ' p , P > ( p : P , config : & BartConfig ) -> BartForSequenceClassification where P : Borrow < nn :: Path < ' p > > , { let p = p . borrow ( ) ; let base_model = BartModel :: new ( p / " " , config , false ) ; let classification_head = BartClassificationHead :: new ( p / " " , config ) ; let eos_token_id = match config . eos_token_id { Some ( value ) => value , None => 3 , } ; BartForSequenceClassification { base_model , classification_head , eos_token_id , } }
Build a new `BartForSequenceClassification`
Build a new ` BartForSequenceClassification `
p
P
config
&BartConfig
p
P
config
&BartConfig
example
```no_run
use rust_bert::bart::{BartConfig, BartForSequenceClassification};
use rust_bert::Config;
use std::path::Path;
use tch::{nn, Device}.

let config_path = Path::new("path/to/config.json");
let device = Device::Cpu;
let p = nn::VarStore::new(device);
let config = BartConfig::from_file(config_path);
let generation_mode = true;
let bart: BartForSequenceClassification
BartForSequenceClassification::new(&p.root() / "bart", &config);
```
` ` ` no_run use rust_bert :: bart :: { BartConfig BartForSequenceClassification } ; use rust_bert :: Config ; use std :: path :: Path ; use tch :: { nn Device } . let config_path = Path :: new ( " path / to / config . json " ) ; let device = Device :: Cpu ; let p = nn :: VarStore :: new ( device ) ; let config = BartConfig :: from_file ( config_path ) ; let generation_mode = true ; let bart : BartForSequenceClassification BartForSequenceClassification :: new ( &p . root () / " bart " &config ) ; ` ` `