Skip to main content

Module text

Module text 

Source
Expand description

Text generation utilities for character-level language models.

Provides vocabulary management, character embeddings, and sampling strategies.

Structs§

CharacterEmbedding
Trainable character embedding layer.
EmbeddingGradients
Gradients for character embedding layer.
TextVocabulary
Character vocabulary for text generation tasks.

Functions§

argmax
Get argmax (greedy decoding).
sample_nucleus
Nucleus (top-p) sampling.
sample_top_k
Sample from top-k most likely tokens.
sample_with_temperature
Sample from logits with temperature scaling.
softmax
Apply softmax to logits.