///|
/// A tokenized question, ready for the model.
struct Prompt {
ids : Array[Int]
/// Position of each option's `[MASK]` marker within `ids`.
markers : Array[Int]
type_index : Int
} derive(Debug, Eq)
///|
/// The token ids.
pub fn Prompt::ids(self : Prompt) -> Array[Int] {
self.ids
}
///|
/// The question-type index (0 choice, 1 score, 2 noul).
pub fn Prompt::type_index(self : Prompt) -> Int {
self.type_index
}
///|
/// The option marker positions.
pub fn Prompt::markers(self : Prompt) -> Array[Int] {
self.markers
}
///|
/// Number of tokens.
pub fn Prompt::length(self : Prompt) -> Int {
self.ids.length()
}
///|
/// Per-option token budget, before the shared budget is applied.
const OPTION_TOKEN_LIMIT : Int = 48
///|
/// Build Laya's input sequence for one question over one state.
///
/// The layout is
/// `[CLS] question: [SEP] [MASK]