diff options
author | Laurent Mazare <laurent.mazare@gmail.com> | 2023-10-28 20:00:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-28 19:00:39 +0100 |
commit | 012ae0090e70da67987a0308ef18587e9e8a8e44 (patch) | |
tree | b6f50c7e0d460d7abcaa2110568ec7af11ebd7d3 /candle-transformers/src/models/llama2_c.rs | |
parent | 95a857cf57c56a34ecdaae5372f2a13ebd900001 (diff) | |
download | candle-012ae0090e70da67987a0308ef18587e9e8a8e44.tar.gz candle-012ae0090e70da67987a0308ef18587e9e8a8e44.tar.bz2 candle-012ae0090e70da67987a0308ef18587e9e8a8e44.zip |
Infer the config for llama2-c. (#1208)
Diffstat (limited to 'candle-transformers/src/models/llama2_c.rs')
-rw-r--r-- | candle-transformers/src/models/llama2_c.rs | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/candle-transformers/src/models/llama2_c.rs b/candle-transformers/src/models/llama2_c.rs index 07a6e2f2..753770fb 100644 --- a/candle-transformers/src/models/llama2_c.rs +++ b/candle-transformers/src/models/llama2_c.rs @@ -17,7 +17,20 @@ pub struct Config { } impl Config { - pub fn tiny() -> Self { + pub fn tiny_260k() -> Self { + Self { + dim: 64, + hidden_dim: 768, + n_layers: 5, + n_heads: 8, + n_kv_heads: 4, + vocab_size: 32000, + seq_len: 512, + norm_eps: 1e-5, + } + } + + pub fn tiny_15m() -> Self { Self { dim: 288, hidden_dim: 768, @@ -29,6 +42,32 @@ impl Config { norm_eps: 1e-5, } } + + pub fn tiny_42m() -> Self { + Self { + dim: 512, + hidden_dim: 768, + n_layers: 8, + n_heads: 8, + n_kv_heads: 8, + vocab_size: 32000, + seq_len: 1024, + norm_eps: 1e-5, + } + } + + pub fn tiny_110m() -> Self { + Self { + dim: 768, + hidden_dim: 768, + n_layers: 12, + n_heads: 12, + n_kv_heads: 12, + vocab_size: 32000, + seq_len: 1024, + norm_eps: 1e-5, + } + } } #[derive(Clone)] |