code: def caption(model, processor, prompt: str, image: Image.Image) -> str:
      inputs = processor(prompt, image, return_tensors="pt")
      for possible_key in ["images", "pixel_values"]:
          if not possible_key in inputs:
              continue
          inputs[possible_key] = inputs[possible_key].to(
              dtype
          )  # Downcast floats
      inputs = {
          k: v.to(device) for k, v in inputs.items()
      }  # Move to the right device
  
      with torch.inference_mode():
          output = model.generate(
              **inputs,
              do_sample=False,
              # use_cache=True,
              max_new_tokens=128,
              eos_token_id=32001,
              pad_token_id=processor.tokenizer.pad_token_id,
          )
      prompt_len = inputs["input_ids"].shape[1]
      decoded_text = processor.batch_decode(
          output[:, prompt_len:],
          skip_special_tokens=True,
      )[0].strip()
      return decoded_text
  
file_path: uform/scripts/bench.py
imports: import requests
  from time import perf_counter
  from typing import List
  from PIL import Image
  import torch
  from uform import get_model
  from uform.gen_model import VLMForCausalLM, VLMProcessor
  from transformers import InstructBlipProcessor, InstructBlipForConditionalGeneration
  from transformers import AutoProcessor, LlavaForConditionalGeneration
label_desc: Use image node_id 1 for calling a global function with example usage: caption(model, processor, prompt, image) and returns: decoded_text