code: def run(request):
      global mii_config, model
      assert (
          model is not None
      ), "grpc client has not been setup when this model was created"
  
      request_dict = json.loads(request)
  
      query_dict = mii.utils.extract_query_dict(
          mii_config.task, request_dict
      )
  
      response = model.query(query_dict, **request_dict)
  
      time_taken = response.time_taken
      if not isinstance(response.response, str):
          response = [r for r in response.response]
      return json.dumps({"responses": response, "time": time_taken})
  
imports: import os
  import json
  import time
  import torch
  import mii.legacy
label_desc: Use image node_id 2 for calling a global function with example usage: run(request) and returns: json