class_docstr: Args:
      requests: List of prompts
      tokenizer: model tokenizer
      tokens_to_generate: int value denoting amount of tokens model should generate
      compute_logprobs: bool value denoting if model should generate tokens or compute logprobs
  Returns:
      data: class object
          {'data': tokens, 'tokens_to_generate': tokens_to_generate, 'compute_logprobs': compute_logprobs}
          * data: List of token's ids in respect to prompts
          * tokens_to_generate: int value denoting amount of tokens model should generate
          * compute_logprobs: bool value denoting if model should generate tokens or compute logprobs
class_docstr_tok: ["Args",":","requests",":","List","of","prompts","tokenizer",":","model","tokenizer","tokens_to_generate",":","int","value","denoting","amount","of","tokens","model","should","generate","compute_logprobs",":","bool","value","denoting","if","model","should","generate","tokens","or","compute","logprobs","Returns",":","data",":","class","object","{","'data","'",":","tokens",",","'tokens_to_generate","'",":","tokens_to_generate",",","'compute_logprobs","'",":","compute_logprobs","}","*","data",":","List","of","token","'s","ids","in","respect","to","prompts","*","tokens_to_generate",":","int","value","denoting","amount","of","tokens","model","should","generate","*","compute_logprobs",":","bool","value","denoting","if","model","should","generate","tokens","or","compute","logprobs"]
code: def __init__(
      self,
      requests: List,
      tokenizer,
      tokens_to_generate: int,
      compute_logprobs: bool,
  ) -> None:
      super().__init__()
      self.requests = requests
      self.tokenizer = tokenizer
      self.tokens_to_generate = tokens_to_generate
      self.compute_logprobs = compute_logprobs
      self.tokens = []
      self.prompt_tags = []
  
      # tokenize prompt
      for request in self.requests:
          if type(request) == dict:
              prompt_tag = request["prompt_tag"]
              self.prompt_tags.append(prompt_tag)
              text = request["text"]
          else:
              text = request
  
          self.tokens.append(
              torch.tensor(self.tokenizer.text_to_ids(text))
          )
  
      if self.prompt_tags:
          self.data = {
              "prompt_tags": self.prompt_tags,
              "data": self.tokens,
              "tokens_to_generate": self.tokens_to_generate,
              "compute_logprobs": self.compute_logprobs,
          }
  
      else:
          self.data = {
              "data": self.tokens,
              "tokens_to_generate": self.tokens_to_generate,
              "compute_logprobs": self.compute_logprobs,
          }
  
file_path: NeMo/nemo/collections/nlp/data/language_modeling/megatron/request_dataset.py
imports: from typing import Dict, List
  import torch
  from torch.utils.data.dataset import Dataset
label_desc: Use image node_id 1 to create a new GPTRequestDataset object from inherited base classes: Dataset with example: obj = GPTRequestDataset(requests, tokenizer, tokens_to_generate, compute_logprobs)