class_docstr: Wrapper around bigdl-llm embedding models.
  
  param model_path: If running with ``native int4``, the path should be converted BigDL-LLM
        optimized ggml binary checkpoint, which should be converted by ``bigdl.llm.llm_convert``.
        If running with ``transformers int4``, the path should be the huggingface repo id
        to be downloaded or the huggingface checkpoint folder.
  
  Example:
      .. code-block:: python
  
          from bigdl.llm.langchain.embeddings import LlamaEmbeddings
          llama = LlamaEmbeddings(model_path="/path/to/model.bin")
class_docstr_tok: ["Wrapper","around","bigdl-llm","embedding","models",".","param","model_path",":","If","running","with","``","native","int4","``",",","the","path","should","be","converted","BigDL-LLM","optimized","ggml","binary","checkpoint",",","which","should","be","converted","by","``","bigdl.llm.llm_convert","``",".","If","running","with","``","transformers","int4","``",",","the","path","should","be","the","huggingface","repo","id","to","be","downloaded","or","the","huggingface","checkpoint","folder",".","Example",":","..","code-block",":",":","python","from","bigdl.llm.langchain.embeddings","import","LlamaEmbeddings","llama","=","LlamaEmbeddings","(","model_path=","''","\/path\/to\/model.bin","''",")"]
docstr: Validate that bigdl-llm library is installed.
docstr_tok: ["Validate","that","bigdl-llm","library","is","installed","."]
code: def validate_environment(cls, values: Dict) -> Dict:
      """Validate that bigdl-llm library is installed."""
  
      native = values["native"]
      model_path = values["model_path"]
      model_kwargs = values["model_kwargs"]
      kwargs = values["kwargs"]
      model_param_names = [
          "n_ctx",
          "n_parts",
          "seed",
          "f16_kv",
          "logits_all",
          "vocab_only",
          "use_mlock",
          "n_threads",
          "n_batch",
      ]
      model_params = {k: values[k] for k in model_param_names}
      # For backwards compatibility, only include if non-null.
      if values["n_gpu_layers"] is not None:
          model_params["n_gpu_layers"] = values["n_gpu_layers"]
  
      try:
          module = importlib.import_module(values["ggml_module"])
          class_ = getattr(module, values["ggml_model"])
  
          if native:
              values["client"] = class_(
                  model_path, embedding=True, **model_params
              )
          else:
              kwargs = {} if kwargs is None else kwargs
              values["client"] = TransformersEmbeddings.from_model_id(
                  model_path, model_kwargs, **kwargs
              )
  
          # from bigdl.llm.ggml.model.llama import Llama
  
          # values["client"] = Llama(model_path, embedding=True, **model_params)
  
      except ImportError:
          raise ModuleNotFoundError(
              "Could not import bigdl-llm library. "
              "Please install the bigdl-llm library to "
              "use this embedding model: pip install bigdl-llm"
          )
      except Exception as e:
          raise ValueError(
              f"Could not load model from path: {model_path}. "
              f"Please make sure the model embedding class matches "
              "the model you want to load."
              f"Received error {e}"
          )
  
      return values
  
imports: import logging
  import importlib
  from typing import Any, Dict, List, Optional
  from pydantic import BaseModel, Extra, Field, root_validator
  from langchain.embeddings.base import Embeddings
  from .transformersembeddings import TransformersEmbeddings
label_desc: Use image node_id 1 for calling the _BaseEmbeddings obj's underlying member method code with example usage: obj.validate_environment(cls, values) and returns: values