Jina Bert Example fix and more configuration (#2191)

* fix: fix jina bert example logic

* feat: enable jina embeddings de

* feat: allow more flexibility on Jina Bert
This commit is contained in:
Joan Fontanals
2024-08-01 06:59:20 -05:00
committed by GitHub
parent ac51f477eb
commit 2e9c010609
2 changed files with 58 additions and 12 deletions

View File

@ -47,6 +47,36 @@ impl Config {
position_embedding_type: PositionEmbeddingType::Alibi,
}
}
pub fn new(
vocab_size: usize,
hidden_size: usize,
num_hidden_layers: usize,
num_attention_heads: usize,
intermediate_size: usize,
hidden_act: candle_nn::Activation,
max_position_embeddings: usize,
type_vocab_size: usize,
initializer_range: f64,
layer_norm_eps: f64,
pad_token_id: usize,
position_embedding_type: PositionEmbeddingType,
) -> Self {
Config {
vocab_size,
hidden_size,
num_hidden_layers,
num_attention_heads,
intermediate_size,
hidden_act,
max_position_embeddings,
type_vocab_size,
initializer_range,
layer_norm_eps,
pad_token_id,
position_embedding_type,
}
}
}
#[derive(Clone, Debug)]