code: def benchmark(model, model_desc="original BERT"):
      times = []
  
      # Warmup for 30 iterations
      for encoded_input in encoded_inputs[:30]:
          with torch.no_grad():
              _ = model(**encoded_input)
  
      # Benchmark
      for encoded_input in encoded_inputs:
          st = time.perf_counter()
          with torch.no_grad():
              _ = model(**encoded_input)
          times.append(time.perf_counter() - st)
      original_model_time = sum(times) / len(times) * 1000
      print(
          f"Average response time for {model_desc}: {original_model_time} ms"
      )
  
file_path: nebuly/optimization/speedster/notebooks/huggingface/faster_transformer_bert.py
imports: import logging
  import random
  import time
  import speedster
  import torch
  from speedster import optimize_model
  from nebullvm.operations.optimizations.compilers.faster_transformer.bert import detect_and_swap_bert_model
  from nebullvm.operations.optimizations.compilers.utils import get_faster_transformer_repo_path
  from transformers import BertTokenizer
  from transformers.models.bert.modeling_bert import BertForSequenceClassification
label_desc: Use image node_id 4 for calling a global function with example usage: benchmark(model, model_desc) without return types