code: def test_eval(model, tokenizer):
      """Query the model with a single prompt to sanity check it."""
  
      print("Starting model evaluation...")
  
      model.eval()
      model.to("cuda")
  
      print("Prompting model with promtp : ", TEST_PROMPT)
      input_ids = tokenizer(TEST_PROMPT, return_tensors="pt")[
          "input_ids"
      ].to("cuda")
  
      stop_token_embeding = tokenizer(
          STOP_TOKEN, return_tensors="pt", add_special_tokens=False
      )["input_ids"].to("cuda")
  
      def custom_stopping_criteria(embeddings, *args, **kwargs) -> bool:
          return stop_token_embeding in embeddings
  
      stopping_criteria = StoppingCriteriaList(
          [custom_stopping_criteria]
      )
  
      with torch.no_grad():
          generation_output = model.generate(
              input_ids=input_ids,
              output_scores=True,
              max_new_tokens=500,
              stopping_criteria=stopping_criteria,
          )
  
      decoded = tokenizer.batch_decode(generation_output)
      print("Outputs: ", decoded)
  
file_path: ray/doc/source/templates/04_finetuning_llms_with_deepspeed/merge_lora_weights.py
imports: import torch
  import argparse
  import time
  import peft
  from pathlib import Path
  from transformers import AutoModelForCausalLM, AutoTokenizer, StoppingCriteriaList
  from utils import download_model, get_mirror_link, get_checkpoint_and_refs_dir
label_desc: Use image node_id 2 for calling a global function with example usage: test_eval(model, tokenizer) and returns: unknown