class_docstr: Wrapper for a Huggingface Transformers GPT-2 model.
  
  This class loads a tokenizer and model using the Huggingface library and
  provides the LIT-required functions plus additional helper functions to
  convert and clean tokens and to compute the top_k predictions from logits.
class_docstr_tok: ["Wrapper","for","a","Huggingface","Transformers","GPT-2","model",".","This","class","loads","a","tokenizer","and","model","using","the","Huggingface","library","and","provides","the","LIT-required","functions","plus","additional","helper","functions","to","convert","and","clean","tokens","and","to","compute","the","top_k","predictions","from","logits","."]
code: def input_spec(self):
      return {"text": lit_types.TextSegment()}
  
imports: import re
  from lit_nlp.api import model
  from lit_nlp.api import types
  from lit_nlp.examples.models import model_utils
  from lit_nlp.lib import file_cache
  from lit_nlp.lib import utils
  import numpy
  import tensorflow
  import transformers
label_desc: Use image node_id 10 for calling the GPT2LanguageModel obj's underlying member method code with example usage: obj.input_spec() and returns: dict