code: def __init__(self, tokenizer, examples, loss_on_prefix=True):
      self.examples = examples
      self.qns = [ex["question"] for ex in self.examples]
      self.ans = [ex["answer"] for ex in self.examples]
      self.qns = tokenizer(self.qns, padding=False)
      self.ans = tokenizer(self.ans, padding=False)
      self.loss_on_prefix = loss_on_prefix
      self.max_len = max(
          [
              len(self.qns["input_ids"][i])
              + len(self.ans["input_ids"][i])
              for i in range(len(self.examples))
          ]
      )
      print(f"Max tokens: {self.max_len}")
  
file_path: grade-school-math/grade_school_math/dataset.py
imports: import json
  import os
  import re
  import torch
label_desc: Use image node_id 1 to create a new GSMDataset object from inherited base classes: th.utils.data with example: obj = GSMDataset(tokenizer, examples, loss_on_prefix)