mirror of
https://github.com/huggingface/candle.git
synced 2025-06-16 02:38:10 +00:00
Add support for the marian base model. (#1221)
This commit is contained in:
@ -51,6 +51,31 @@ impl Config {
|
||||
vocab_size: 53017,
|
||||
}
|
||||
}
|
||||
|
||||
// https://huggingface.co/Helsinki-NLP/opus-mt-fr-en/blob/main/config.json
|
||||
pub fn opus_mt_fr_en() -> Self {
|
||||
Self {
|
||||
activation_function: candle_nn::Activation::Swish,
|
||||
d_model: 512,
|
||||
decoder_attention_heads: 8,
|
||||
decoder_ffn_dim: 2048,
|
||||
decoder_layers: 6,
|
||||
decoder_start_token_id: 59513,
|
||||
decoder_vocab_size: Some(59514),
|
||||
encoder_attention_heads: 8,
|
||||
encoder_ffn_dim: 2048,
|
||||
encoder_layers: 6,
|
||||
eos_token_id: 0,
|
||||
forced_eos_token_id: 0,
|
||||
is_encoder_decoder: true,
|
||||
max_position_embeddings: 512,
|
||||
pad_token_id: 59513,
|
||||
scale_embedding: true,
|
||||
share_encoder_decoder_embeddings: true,
|
||||
use_cache: true,
|
||||
vocab_size: 59514,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
|
Reference in New Issue
Block a user