class_docstr: High-level Python wrapper for a gptneox.cpp model.
class_docstr_tok: ["High-level","Python","wrapper","for","a","gptneox.cpp","model","."]
docstr: Embed a string.
  
  Args:
      input: The utf-8 encoded string to embed.
  
  Returns:
      An embedding object.
docstr_tok: ["Embed","a","string",".","Args",":","input",":","The","utf-8","encoded","string","to","embed",".","Returns",":","An","embedding","object","."]
code: def create_embedding(self, input: str) -> Embedding:
      """Embed a string.
  
      Args:
          input: The utf-8 encoded string to embed.
  
      Returns:
          An embedding object.
      """
      invalidInputError(
          self.ctx is not None,
          "The attribute `ctx` of `Gptneox` object is None.",
      )
  
      invalidInputError(
          self.params.embedding,
          "Gptneox model must be created with embedding=True to call this method.",
      )
  
      if self.verbose:
          gptneox_cpp.gptneox_reset_timings(self.ctx)
  
      tokens = self.tokenize(input.encode("utf-8"))
      self.reset()
      self.eval(tokens)
      n_tokens = len(tokens)
      embedding = gptneox_cpp.gptneox_get_embeddings(self.ctx)[
          : gptneox_cpp.gptneox_n_embd(self.ctx)
      ]
  
      if self.verbose:
          gptneox_cpp.gptneox_print_timings(self.ctx)
  
      return {
          "object": "list",
          "data": [
              {
                  "object": "embedding",
                  "embedding": embedding,
                  "index": 0,
              }
          ],
          "model": self.model_path,
          "usage": {
              "prompt_tokens": n_tokens,
              "total_tokens": n_tokens,
          },
      }
  
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 10 for calling the Gptneox obj's underlying member method code with example usage: obj.create_embedding(input) and returns: dict