class_docstr: High-level Python wrapper for a llama.cpp model.
docstr: Generate text from a prompt.
  
  Args:
      prompt: The prompt to generate text from.
      suffix: A suffix to append to the generated text. If None, no suffix is appended.
      max_tokens: The maximum number of tokens to generate.
      temperature: The temperature to use for sampling.
      top_p: The top-p value to use for sampling.
      logprobs: The number of logprobs to return. If None, no logprobs are returned.
      echo: Whether to echo the prompt.
      stop: A list of strings to stop generation when encountered.
      repeat_penalty: The penalty to apply to repeated tokens.
      top_k: The top-k value to use for sampling.
      stream: Whether to stream the results.
  
  Raises:
      ValueError: If the requested tokens exceed the context window.
      RuntimeError: If the prompt fails to tokenize or the model fails to evaluate the prompt.
  
  Returns:
      Response object containing the generated text.
docstr_tok: ["Generate","text","from","a","prompt",".","Args",":","prompt",":","The","prompt","to","generate","text","from",".","suffix",":","A","suffix","to","append","to","the","generated","text",".","If","None",",","no","suffix","is","appended",".","max_tokens",":","The","maximum","number","of","tokens","to","generate",".","temperature",":","The","temperature","to","use","for","sampling",".","top_p",":","The","top-p","value","to","use","for","sampling",".","logprobs",":","The","number","of","logprobs","to","return",".","If","None",",","no","logprobs","are","returned",".","echo",":","Whether","to","echo","the","prompt",".","stop",":","A","list","of","strings","to","stop","generation","when","encountered",".","repeat_penalty",":","The","penalty","to","apply","to","repeated","tokens",".","top_k",":","The","top-k","value","to","use","for","sampling",".","stream",":","Whether","to","stream","the","results",".","Raises",":","ValueError",":","If","the","requested","tokens","exceed","the","context","window",".","RuntimeError",":","If","the","prompt","fails","to","tokenize","or","the","model","fails","to","evaluate","the","prompt",".","Returns",":","Response","object","containing","the","generated","text","."]
code: def create_completion(
      self,
      prompt: str,
      suffix: Optional[str] = None,
      max_tokens: int = 128,
      temperature: float = 0.8,
      top_p: float = 0.95,
      logprobs: Optional[int] = None,
      echo: bool = False,
      stop: Optional[Union[str, List[str]]] = [],
      frequency_penalty: float = 0.0,
      presence_penalty: float = 0.0,
      repeat_penalty: float = 1.1,
      top_k: int = 40,
      stream: bool = False,
      tfs_z: float = 1.0,
      mirostat_mode: int = 0,
      mirostat_tau: float = 5.0,
      mirostat_eta: float = 0.1,
      model: Optional[str] = None,
  ) -> Union[Completion, Iterator[CompletionChunk]]:
      """Generate text from a prompt.
  
      Args:
          prompt: The prompt to generate text from.
          suffix: A suffix to append to the generated text. If None, no suffix is appended.
          max_tokens: The maximum number of tokens to generate.
          temperature: The temperature to use for sampling.
          top_p: The top-p value to use for sampling.
          logprobs: The number of logprobs to return. If None, no logprobs are returned.
          echo: Whether to echo the prompt.
          stop: A list of strings to stop generation when encountered.
          repeat_penalty: The penalty to apply to repeated tokens.
          top_k: The top-k value to use for sampling.
          stream: Whether to stream the results.
  
      Raises:
          ValueError: If the requested tokens exceed the context window.
          RuntimeError: If the prompt fails to tokenize or the model fails to evaluate the prompt.
  
      Returns:
          Response object containing the generated text.
      """
      completion_or_chunks = self._create_completion(
          prompt=prompt,
          suffix=suffix,
          max_tokens=max_tokens,
          temperature=temperature,
          top_p=top_p,
          logprobs=logprobs,
          echo=echo,
          stop=stop,
          frequency_penalty=frequency_penalty,
          presence_penalty=presence_penalty,
          repeat_penalty=repeat_penalty,
          top_k=top_k,
          stream=stream,
          tfs_z=tfs_z,
          mirostat_mode=mirostat_mode,
          mirostat_tau=mirostat_tau,
          mirostat_eta=mirostat_eta,
          model=model,
      )
      if stream:
          chunks: Iterator[CompletionChunk] = completion_or_chunks
          return chunks
      completion: Completion = next(completion_or_chunks)  # type: ignore
      return completion
  
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 13 for calling the Llama obj's underlying member method code with example usage: obj.create_completion(prompt, suffix, max_tokens, temperature, top_p, logprobs, echo, stop, frequency_penalty, presence_penalty, repeat_penalty, top_k, stream, tfs_z, mirostat_mode, mirostat_tau, mirostat_eta, model) and returns: completion, chunks