class_docstr: ## Dataset for fine-tuning GPT-NeoX
  
  This is not optimized to very large datasets.
class_docstr_tok: ["#","#","Dataset","for","fine-tuning","GPT-NeoX","This","is","not","optimized","to","very","large","datasets","."]
docstr: ### Get a sample
  
  :param idx: is the index of the sample
  :return: the input and the target
docstr_tok: ["#","#","#","Get","a","sample",":","param","idx",":","is","the","index","of","the","sample",":","return",":","the","input","and","the","target"]
code: def __getitem__(self, idx: int):
      """
      ### Get a sample
  
      :param idx: is the index of the sample
      :return: the input and the target
      """
      offset = idx * self.seq_len
      return (
          self.tokens[offset : offset + self.seq_len],
          self.tokens[offset + 1 : offset + 1 + self.seq_len],
      )
  
file_path: annotated_deep_learning_paper_implementations/labml_nn/neox/utils/text_dataset.py
imports: from pathlib import PurePath, Path
  from typing import Optional, List
  import torch
  import torch.utils.data
  from labml import lab
  from labml import monit
  from labml.logger import inspect
  from labml.utils.download import download_file
  from labml_nn.neox.tokenizer import get_tokenizer
label_desc: Use image node_id 3 for calling the NeoXDataset obj's underlying member method code with example usage: obj.__getitem__(idx) and returns: self,  self