class_docstr: Tokenizer for gpt-2 and RoBERTa.
class_docstr_tok: ["Tokenizer","for","gpt-2","and","RoBERTa","."]
code: def from_config(cls, config: Config):
      # TODO: T57433776 remove once FairSeq support PathManager
      config.bpe_encoder_path = PathManager.get_local_path(
          config.bpe_encoder_path
      )
      config.bpe_vocab_path = PathManager.get_local_path(
          config.bpe_vocab_path
      )
  
      bpe = create_gpt2_bpe(
          config.bpe_encoder_path, config.bpe_vocab_path
      )
      # This hacks the bpe instance to be picklable
      bpe = copy.copy(bpe)
  
      bpe.__class__ = PickleableGPT2BPEEncoder
  
      return cls(bpe, config.lowercase)
  
imports: import copy
  import json
  import re
  from collections import OrderedDict
  from typing import List, NamedTuple, Optional, Union
  import torch
  from fairseq.data.encoders.gpt2_bpe import get_encoder
  from fairseq.data.encoders.gpt2_bpe_utils import Encoder
  from pytext.config import ConfigBase
  from pytext.config.component import Component, ComponentType, create_component
  from pytext.data.pickleable_gpt2bpe_encoder import PickleableGPT2BPEEncoder
  from pytext.torchscript.tokenizer import ScriptDoNothingTokenizer, ScriptWordTokenizer
  from pytext.utils.file_io import PathManager
  from pytext.utils.usage import log_class_usage
  from transformers.tokenization_bert import BasicTokenizer, WordpieceTokenizer
label_desc: Use image node_id 1 for calling the GPT2BPETokenizer obj's underlying member method code with example usage: obj.from_config(cls, config) and returns: cls