code: def predict(inp):
      inp = transforms.ToTensor()(inp).unsqueeze(0)
      with torch.no_grad():
          prediction = torch.nn.functional.softmax(model(inp)[0], dim=0)
          confidences = {
              labels[i]: float(prediction[i]) for i in range(1000)
          }
      return confidences
  
imports: import gradio
  import torch
  import requests
  from torchvision import transforms
label_desc: Use image node_id 1 for calling a global function with example usage: predict(inp) and returns: confidences