code: def to_pb(self) -> generate_pb2.Tokens:
      return generate_pb2.Tokens(
          ids=self.token_ids,
          logprobs=self.logprobs,
          texts=self.texts,
          is_special=self.is_special,
      )
  
imports: from functools import total_ordering
  import torch
  from abc import ABC, abstractmethod
  from dataclasses import dataclass
  from typing import List, Optional
  from transformers import PreTrainedTokenizerBase
  from text_generation_server.pb import generate_pb2
  from text_generation_server.pb.generate_pb2 import FinishReason
label_desc: Use image node_id 1 for calling the Tokens obj's underlying member method code with example usage: obj.to_pb() and returns: generate_pb2