class_docstr: High-level Python wrapper for a llama.cpp model.
docstr: Evaluate a list of tokens.
  
  Args:
      tokens: The list of tokens to evaluate.
docstr_tok: ["Evaluate","a","list","of","tokens",".","Args",":","tokens",":","The","list","of","tokens","to","evaluate","."]
code: def eval(self, tokens: Sequence[int]):
      """Evaluate a list of tokens.
  
      Args:
          tokens: The list of tokens to evaluate.
      """
      invalidInputError(
          self.ctx is not None,
          "The attribute `ctx` of `Llama` object is None.",
      )
      n_ctx = int(llama_cpp.llama_n_ctx(self.ctx))
      for i in range(0, len(tokens), self.n_batch):
          batch = tokens[i : min(len(tokens), i + self.n_batch)]
          n_past = min(n_ctx - len(batch), len(self.eval_tokens))
          n_tokens = len(batch)
          return_code = llama_cpp.llama_eval(
              ctx=self.ctx,
              tokens=(llama_cpp.llama_token * len(batch))(*batch),
              n_tokens=llama_cpp.c_int(n_tokens),
              n_past=llama_cpp.c_int(n_past),
              n_threads=llama_cpp.c_int(self.n_threads),
          )
          invalidInputError(
              int(return_code) == 0,
              f"llama_eval returned {return_code}.",
          )
          # Save tokens
          self.eval_tokens.extend(batch)
          # Save logits
          rows = n_tokens if self.params.logits_all else 1
          n_vocab = llama_cpp.llama_n_vocab(self.ctx)
          cols = int(n_vocab)
          logits_view = llama_cpp.llama_get_logits(self.ctx)
          logits: List[List[float]] = [
              [logits_view[i * cols + j] for j in range(cols)]
              for i in range(rows)
          ]
          self.eval_logits.extend(logits)
  
imports: import os
  import sys
  import uuid
  import time
  import math
  import multiprocessing
  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 llama_cpp
  from .llama_types import *
label_desc: Use image node_id 6 for calling the Llama obj's underlying member method code with example usage: obj.eval(tokens) without return types