transformer
Transformer
Bases: Distribution
Source code in hfppl/distributions/transformer.py
__init__(lm, prompt, temp=1.0)
Create a Categorical distribution whose values are Tokens, with probabilities given by a language model. Supports auto-batching.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
lm
|
CachedCausalLM
|
the language model. |
required |
prompt
|
str | TokenSequence
|
the sequence of tokens to use as the prompt. If a string, |
required |
temp
|
float
|
temperature at which to generate (0 < |
1.0
|