code: def test_gradio_long_context_uuid_key_value_retrieval(
      base_model, rope_scaling, prompt_len, rel_secret_pos, client
  ):
      import ast
  
      rope_scaling_factor = 1
      if rope_scaling:
          rope_scaling = ast.literal_eval(rope_scaling)
          rope_scaling_factor = rope_scaling.get("factor")
      from transformers import AutoConfig
  
      config = AutoConfig.from_pretrained(
          base_model, token=True, trust_remote_code=True
      )
      max_len = 4096
      if hasattr(config, "max_position_embeddings"):
          max_len = config.max_position_embeddings
      if prompt_len > max_len * rope_scaling_factor:
          pytest.xfail("no chance")
      secret_pos = int(prompt_len * rel_secret_pos)
      prompt = create_long_prompt_with_secret(
          prompt_len=prompt_len,
          secret_pos=secret_pos,
          model_name=base_model,
      )
  
      if client:
          main_kwargs = dict(
              base_model=base_model,
              chat=True,
              stream_output=False,
              gradio=True,
              num_beams=1,
              prompt_type="plain",  # prompting done explicitly above, so can use with generate() below
              block_gradio_exit=False,
              rope_scaling=rope_scaling,
              use_auth_token=True,
              save_dir="long_context",
          )
          from src.gen import main
  
          main(**main_kwargs)
          from src.client_test import run_client_chat
  
          res_dict, client = run_client_chat(
              prompt=prompt,
              stream_output=False,
              max_new_tokens=16384,
              langchain_mode="Disabled",
              langchain_action=LangChainAction.QUERY.value,
              langchain_agents=[],
          )
          assert res_dict["prompt"] == prompt
          assert res_dict["iinput"] == ""
          response = res_dict["response"]
      else:
          from transformers import AutoModelForCausalLM, AutoTokenizer
  
          tokenizer = AutoTokenizer.from_pretrained(base_model)
          model = AutoModelForCausalLM.from_pretrained(
              base_model,
              device_map="auto",
              rope_scaling=rope_scaling,
          )
          inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
          print(inputs.input_ids.shape)
          gen_out = model.generate(**inputs, max_new_tokens=300)
          response = tokenizer.batch_decode(gen_out)[0]
          response = response.split("</s>")[0]
          print(response)
          response = response.replace(prompt, "").replace(
              "<s> ", ""
          )  # only keep response
  
      print(
          f"\nLLM response (expected value is '{SECRET_VALUE}'):",
          flush=True,
      )
      print(response)
      assert SECRET_VALUE in response
      print("DONE", flush=True)
  
file_path: h2ogpt/tests/test_long_context.py
imports: import pytest
  from tests.utils import wrap_test_forked
  from src.enums import LangChainAction
  from importlib.metadata import version
  from packaging import version
  import uuid
label_desc: Use image node_id 6 for calling a global function with example usage: test_gradio_long_context_uuid_key_value_retrieval(base_model, rope_scaling, prompt_len, rel_secret_pos, client) without return types