code: def eval_bert():
      # Bert-QA
      from extra.models.bert import BertForQuestionAnswering
  
      mdl = BertForQuestionAnswering()
      mdl.load_from_pretrained()
  
      @TinyJit
      def run(input_ids, input_mask, segment_ids):
          return mdl(input_ids, input_mask, segment_ids).realize()
  
      from extra.datasets.squad import iterate
      from examples.mlperf.helpers import get_bert_qa_prediction
      from examples.mlperf.metrics import f1_score
      from transformers import BertTokenizer
  
      tokenizer = BertTokenizer(
          str(Path(__file__).parents[2] / "weights/bert_vocab.txt")
      )
  
      c = 0
      f1 = 0.0
      st = time.perf_counter()
      for X, Y in iterate(tokenizer):
          mt = time.perf_counter()
          outs = []
          for x in X:
              outs.append(
                  run(
                      Tensor(x["input_ids"]),
                      Tensor(x["input_mask"]),
                      Tensor(x["segment_ids"]),
                  ).numpy()
              )
          et = time.perf_counter()
          print(
              f"{(mt-st)*1000:.2f} ms loading data, {(et-mt)*1000:.2f} ms to run model over {len(X)} features"
          )
  
          pred = get_bert_qa_prediction(X, Y, outs)
          print(f"pred: {pred}\nans: {Y['answers']}")
          f1 += max([f1_score(pred, ans) for ans in Y["answers"]])
          c += 1
          print(f"f1: {f1/c}, raw: {f1}, c: {c}\n")
  
          st = time.perf_counter()
  
file_path: tinygrad/examples/mlperf/model_eval.py
imports: import time
  from pathlib import Path
  import numpy
  from tinygrad import Tensor, Device, dtypes, GlobalCounters
  from tinygrad.jit import TinyJit
  from tinygrad.nn.state import get_parameters, load_state_dict, safe_load
  from tinygrad.helpers import getenv, Timing
  from examples.mlperf import helpers
label_desc: Use image node_id 6 for calling a global function with example usage: eval_bert() and returns: mdl