class_docstr: High-level Python wrapper for a gptneox.cpp model.
class_docstr_tok: ["High-level","Python","wrapper","for","a","gptneox.cpp","model","."]
docstr: Sample a token from the model.
  
  Args:
      top_k: The top-k sampling parameter.
      top_p: The top-p sampling parameter.
      temp: The temperature parameter.
      repeat_penalty: The repeat penalty parameter.
  
  Returns:
      The sampled token.
docstr_tok: ["Sample","a","token","from","the","model",".","Args",":","top_k",":","The","top-k","sampling","parameter",".","top_p",":","The","top-p","sampling","parameter",".","temp",":","The","temperature","parameter",".","repeat_penalty",":","The","repeat","penalty","parameter",".","Returns",":","The","sampled","token","."]
code: def sample(
      self,
      top_k: int = 40,
      top_p: float = 0.95,
      temp: float = 0.80,
      repeat_penalty: float = 1.1,
      frequency_penalty: float = 0.0,
      presence_penalty: float = 0.0,
      tfs_z: float = 1.0,
      mirostat_mode: int = 0,
      mirostat_eta: float = 0.1,
      mirostat_tau: float = 5.0,
  ):
      """Sample a token from the model.
  
      Args:
          top_k: The top-k sampling parameter.
          top_p: The top-p sampling parameter.
          temp: The temperature parameter.
          repeat_penalty: The repeat penalty parameter.
  
      Returns:
          The sampled token.
      """
      invalidInputError(
          self.ctx is not None,
          "The attribute `ctx` of `Gptneox` object is None.",
      )
      last_n_tokens_data = [gptneox_cpp.gptneox_token(0)] * max(
          0, self.last_n_tokens_size - len(self.eval_tokens)
      ) + list(self.eval_tokens)[-self.last_n_tokens_size :]
      return self._sample(
          last_n_tokens_data=(
              gptneox_cpp.gptneox_token * self.last_n_tokens_size
          )(*last_n_tokens_data),
          last_n_tokens_size=gptneox_cpp.c_int(self.last_n_tokens_size),
          top_k=gptneox_cpp.c_int(top_k),
          top_p=gptneox_cpp.c_float(top_p),
          temp=gptneox_cpp.c_float(temp),
          tfs_z=gptneox_cpp.c_float(tfs_z),
          repeat_penalty=gptneox_cpp.c_float(repeat_penalty),
          frequency_penalty=gptneox_cpp.c_float(frequency_penalty),
          presence_penalty=gptneox_cpp.c_float(presence_penalty),
          mirostat_mode=gptneox_cpp.c_int(mirostat_mode),
          mirostat_tau=gptneox_cpp.c_float(mirostat_tau),
          mirostat_eta=gptneox_cpp.c_float(mirostat_eta),
      )
  
imports: import os
  import sys
  import uuid
  import time
  import math
  import multiprocessing
  import ctypes
  from typing import List, Optional, Union, Generator, Sequence, Iterator, Deque, Tuple
  from collections import deque, OrderedDict
  from bigdl.llm.utils.common import invalidInputError
  from bigdl.llm.ggml.model.generation import GenerationMixin
  from .None import gptneox_cpp
  from .gptneox_types import *
label_desc: Use image node_id 8 for calling the Gptneox obj's underlying member method code with example usage: obj.sample(top_k, top_p, temp, repeat_penalty, frequency_penalty, presence_penalty, tfs_z, mirostat_mode, mirostat_eta, mirostat_tau) and returns: self