code: def validate_environment(cls, values: Dict) -> Dict:
      model_param_names = [
          "temperature",
          "top_k",
          "top_p",
          "min_p",
          "typical",
          "token_repetition_penalty_max",
          "token_repetition_penalty_sustain",
          "token_repetition_penalty_decay",
          "beams",
          "beam_length",
      ]
  
      config_param_names = [
          "max_seq_len",
          "compress_pos_emb",
          "gpu_peer_fix",
          "alpha_value",
      ]
  
      tuning_parameters = [
          "matmul_recons_thd",
          "fused_mlp_thd",
          "sdp_thd",
          "matmul_fused_remap",
          "rmsnorm_no_half2",
          "rope_no_half2",
          "matmul_no_half2",
          "silu_no_half2",
          "concurrent_streams",
          "fused_attn",
      ]
  
      ##Set logging function if verbose or set to empty lambda
      verbose = values["verbose"]
      if not verbose:
          values["logfunc"] = lambda *args, **kwargs: None
      logfunc = values["logfunc"]
  
      if values["model"] is None:
          model_path = values["model_path"]
          lora_path = values["lora_path"]
  
          tokenizer_path = os.path.join(model_path, "tokenizer.model")
          model_config_path = os.path.join(model_path, "config.json")
          model_path = Exllama.get_model_path_at(model_path)
  
          config = ExLlamaConfig(model_config_path)
          tokenizer = ExLlamaTokenizer(tokenizer_path)
          config.model_path = model_path
  
          configure_config = Exllama.configure_object(
              config_param_names, values, logfunc
          )
          configure_config(config)
          configure_tuning = Exllama.configure_object(
              tuning_parameters, values, logfunc
          )
          configure_tuning(config)
  
          ##Special parameter, set auto map, it's a function
          if values["set_auto_map"]:
              config.set_auto_map(values["set_auto_map"])
              logfunc(f"set_auto_map {values['set_auto_map']}")
  
          model = ExLlama(config)
          exllama_cache = ExLlamaCache(model)
          generator = ExLlamaGenerator(model, tokenizer, exllama_cache)
  
          ##Load and apply lora to generator
          if lora_path is not None:
              lora_config_path = os.path.join(
                  lora_path, "adapter_config.json"
              )
              lora_path = Exllama.get_model_path_at(lora_path)
              lora = ExLlamaLora(model, lora_config_path, lora_path)
              generator.lora = lora
              logfunc(f"Loaded LORA @ {lora_path}")
      else:
          generator = values["model"]
          exllama_cache = generator.cache
          model = generator.model
          config = model.config
          tokenizer = generator.tokenizer
  
      # Set if model existed before or not since generation-time parameters
      configure_model = Exllama.configure_object(
          model_param_names, values, logfunc
      )
      values["stop_sequences"] = [
          x.strip().lower() for x in values["stop_sequences"]
      ]
      configure_model(generator.settings)
  
      setattr(
          generator.settings, "stop_sequences", values["stop_sequences"]
      )
      logfunc(f"stop_sequences {values['stop_sequences']}")
  
      disallowed = values.get("disallowed_tokens")
      if disallowed:
          generator.disallow_tokens(disallowed)
          print(f"Disallowed Tokens: {generator.disallowed_tokens}")
  
      values["client"] = model
      values["generator"] = generator
      values["config"] = config
      values["tokenizer"] = tokenizer
      values["exllama_cache"] = exllama_cache
  
      return values
  
imports: from functools import partial
  from langchain.llms.base import LLM
  from langchain.callbacks.manager import CallbackManagerForLLMRun
  from typing import Any, Dict, List, Optional
  from exllama.model import ExLlama, ExLlamaCache, ExLlamaConfig
  from exllama.tokenizer import ExLlamaTokenizer
  from exllama.generator import ExLlamaGenerator
  from exllama.lora import ExLlamaLora
  import os, glob
  from pydantic.v1 import root_validator
label_desc: Use image node_id 3 for calling the Exllama obj's underlying member method code with example usage: obj.validate_environment(cls, values) and returns: values