Text Workflow Configuration #
Display helpers, generation and corpus option records, training-log metadata, and CLI parsers for text workflows.
Causal LM Display Helpers #
Return a fixed-length token window from a text string.
offset = 0 is the model prompt window; offset = 1 is the usual next-token target window for
causal language modeling. Missing tokens are padded with padId, matching
causalLmXYOneHotMatFloat.
Instances For
Decode a fixed token window extracted by tokenWindow.
Instances For
Escape a short text fragment for one-line terminal output.
Display-only: this does not change tokenizer semantics. Quotes and backslashes use their usual
escapes, common whitespace controls use \\n, \\r, and \\t, and every other ASCII control
character is written as \\xNN. Thus byte-token predictions cannot turn a log into a binary file.
Instances For
Sampling Helpers (Top-k) #
Shared text-generation flags for GPT-style examples.
- prompt : String
Prompt used to seed autoregressive generation.
- generate : ℕ
Number of new tokens to append.
- temperature : Float
Softmax temperature. Must be positive.
- topK : ℕ
Top-k cutoff.
1gives greedy decoding. - repeatPenalty : Float
Penalty subtracted for repeated recent tokens.
0disables it. - repeatWindow : ℕ
Number of recent tokens considered by the repeat penalty.
0disables the window. - seed : ℕ
Deterministic RNG seed for sampling.
- asciiOnly : Bool
Restrict generated ids to a model-specific ASCII allow-list.
Instances For
Instances For
Instances For
Parse the generation flags shared by GPT-style examples.
The model file still owns its training/data flags. This helper only handles prompt, sampling, repeat penalty, deterministic seed, and ASCII restriction.
Instances For
Instances For
Parse generation flags using a full GenerationOptions value as defaults.
This is the public API shape used by model commands: they provide a concrete default prompt and sampling policy, and the shared parser handles the stable CLI surface.
Instances For
Text Workflow Option Records #
Required text-corpus path plus the explicit small-data option used by local corpus trainers.
- dataFile : System.FilePath
UTF-8 or raw-byte corpus path selected by
--data-file. - allowSmallData : Bool
Allow local runs below the normal corpus-size floor.
Instances For
Instances For
Optional text-corpus path selected by --data-file, with caller-supplied default.
- path : System.FilePath
Local text corpus path.
Instances For
Instances For
Parse an optional --data-file flag using the supplied default path.
Instances For
Optional second corpus pass after the main training run.
- finetuneFile? : Option System.FilePath
Optional corpus used for a second fine-tuning pass.
- finetuneSteps : ℕ
Number of optimizer steps used on that second corpus when present.
Instances For
Instances For
Parse the optional --finetune-file / --finetune-steps pair.
The caller supplies the default step count so commands can reuse their main training-step default.
Instances For
Optional GPT-2 BPE tokenizer bundle plus an optional bounded-text cap.
- bpeVocab? : Option System.FilePath
Optional GPT-2
vocab.jsonpath. Must be paired withbpeMerges?. - bpeMerges? : Option System.FilePath
Optional GPT-2
merges.txtpath. Must be paired withbpeVocab?. Optional text-character cap for bounded local BPE runs.
Instances For
Instances For
Parse the optional GPT-2 BPE tokenizer bundle.
--bpe-vocab and --bpe-merges must appear together; --max-chars is independent.
Instances For
Shared terminal-REPL toggle used by interactive text examples.
- interactive : Bool
Keep the trained model alive and read prompts from stdin.
Instances For
Instances For
Parse the shared --interactive flag used by text examples with a terminal prompt loop.
Instances For
Instances For
Parse the shared --prompt / --generate flags.
Instances For
Text TrainLog Notes #
TrainLog note fields for generation-capable text commands.
The stable generation surface is prompt, continuation length, temperature/top-k, repetition
control, RNG seed, and ASCII-only filtering. Model commands can prepend dataset or architecture
notes through extra.
Instances For
Write a before/after loss log for a generation-capable text training command.
Instances For
Write a before/after loss log for a prompt-based text training command.
Instances For
Shared "load one parameter pack, then sample" option surface.
- paramsPath : System.FilePath
JSON bits checkpoint loaded before sampling starts.
Instances For
Parse the shared saved-parameter sampling flags used by inference-only text commands.
Instances For
Text Training Option Combinators #
Number of corpus windows used by a finite or cyclic text-training command.
- windows : ℕ
Number of windows available to the training sampler.
Instances For
Optional parameter-checkpoint paths for text training and generation.
- loadParams? : Option System.FilePath
Checkpoint loaded before training or generation.
- saveParams? : Option System.FilePath
Checkpoint written after training.
Instances For
Instances For
Parse --load-params and --save-params.
Instances For
Logged-training options plus the terminal-REPL toggle.
Instances For
Instances For
Build the shared logged-training + interactive option record.
Instances For
Standard training flags plus the terminal-REPL toggle.
Instances For
Instances For
Build the shared train-flags + interactive option record.
Instances For
Parse the shared "train + interactive" option surface.
Instances For
Logged-training options for promptable interactive text commands.
Instances For
Build the shared logged-training + prompt + interactive option record.
Instances For
Parse the shared "logged train + prompt + interactive" option surface.
Instances For
Corpus-training options for promptable text commands.
This combines the common corpus, fine-tune, BPE, prompt, logging, and interactive controls without tying them to a particular model implementation.
- corpus : TextCorpusOptions
Required primary corpus path plus the small-data override.
- finetune : FinetuneOptions
Optional second corpus pass after the main training run.
- bpe : BpeCorpusOptions
Optional GPT-2 BPE tokenizer bundle.
Instances For
Parse the shared "corpus + logged train + prompt + interactive + optional fine-tune/BPE" surface.
Instances For
Training options for text commands that train and then sample.
Instances For
Instances For
Build the shared train + generation option record.
Instances For
Training options for cyclic text trainers that also expose --windows.
Instances For
Build the shared train + generation + windows option record.
Instances For
Parse the standard "train + generate + windows" option surface.
Instances For
Training options for text commands that support save/load checkpoints.
Instances For
Build the shared train + generation + windows + checkpoint option record.
Instances For
Parse the shared "train + generate + windows + checkpoint" option surface.
Instances For
Training options for text commands with generic batch and context-length controls.
- batch : ℕ
Number of independently sampled training windows per optimizer step.
- seqLen : ℕ
Context length in tokens or characters.
Instances For
Parse the shared "train + generate + windows + checkpoint + batch + seq-len" option surface.
Instances For
Training options for text commands with sampling, checkpointing, and an interactive prompt loop.
Instances For
Build the full train + generation + windows + checkpoint + interactive option record.
Instances For
Parse the full "train + generate + windows + checkpoint + interactive" option surface.