code: def get_output_structure_from_text(
      text: str,
      model: PreTrainedModel,
      tokenizer: PreTrainedTokenizer,
      tokenizer_args: Dict,
      device: Device,
  ) -> Tuple[OrderedDict, Type]:
      """Function needed for saving in a dictionary the output structure of the
      transformers model.
      """
      encoded_input = tokenizer([text], **tokenizer_args)
      if isinstance(model, torch.nn.Module):
          encoded_input = encoded_input.to(device.to_torch_format())
      output = model(**encoded_input)
      structure = OrderedDict()
      if isinstance(output, tuple):
          for i, value in enumerate(output):
              if isinstance(value, (torch.Tensor, tf.Tensor)):
                  structure[f"output_{i}"] = None
              else:
                  size = get_size_recursively(value)
                  structure[f"output_{i}"] = size
      else:
          for key, value in output.items():
              if isinstance(value, (torch.Tensor, tf.Tensor)):
                  structure[key] = None
              else:
                  size = get_size_recursively(value)
                  structure[key] = size
      return structure, type(output)
  
file_path: nebuly/optimization/nebullvm/nebullvm/tools/huggingface.py
imports: from collections import OrderedDict
  from typing import Union, Iterable, List, Dict, Tuple, Type, Any
  import numpy
  from nebullvm.core.models import Device, DeviceType
  from nebullvm.optional_modules.tensorflow import tensorflow
  from nebullvm.optional_modules.torch import torch, Module
label_desc: Use image node_id 3 for calling a global function with example usage: get_output_structure_from_text(text, model, tokenizer, tokenizer_args, device) and returns: structure,  type