1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//! # StarCoder2
//!
//! BigCode StarCoder2 (Lozhkov et al., 2024) is a family of open code-generation
//! models (3B / 7B / 15B parameters).
//!
//! ## Architectural highlights
//!
//! - **Multi-Query Attention** (near-MQA): `num_key_value_heads = 2` for all sizes.
//! - **SwiGLU FFN** with biases on all linear layers.
//! - **RoPE** positional embeddings (θ = 10 000).
//! - **Fill-In-the-Middle (FIM)** for code in-filling tasks.
//! - Optional sliding-window attention (unused in released checkpoints).
//!
//! ## Usage
//!
//! ```rust,no_run
//! use trustformers_models::starcoder2::{StarCoder2Config, StarCoder2ForCausalLM};
//!
//! let config = StarCoder2Config::small_test();
//! let model = StarCoder2ForCausalLM::new(config)?;
//! let logits = model.forward(vec![1u32, 2, 3])?;
//! # Ok::<(), trustformers_core::errors::TrustformersError>(())
//! ```
pub use StarCoder2Config;
pub use ;
pub use ;
pub use ;