a2rl.experimental.lightgpt.LightGPTBuilder.sample#
- LightGPTBuilder.sample(seq, n_steps, temperature=1.0, sample=False, top_k=False)#
Sample the next
n_stepstoken.- Parameters:
seq (
ndarray) – These is a sequence of GPT tokens. You need to convert dataframe token to GPT token usingTokenizer.gpt_tokenize()n_steps (
int) – Number of steps to predict.temperature (
float) – The temperature controls the randomness of predicted samples by scaling the logits before applying softmax.sample (
bool) – WhenTrue, returns random samples of actions from thetop-klogits. Otherwise, straightaway returns thetop-klogits.top_k (
bool) – The number of logits to consider for the returned actions.
- Return type:
- Returns:
The original context, concatenated with the next
n_stepspredicted token.