code: def __init__(
      self, device: str = "cpu", *, use_half: bool = False
  ) -> None:
      if GPT2Tokenizer is None or GPT2LMHeadModel is None:
          raise ValueError(
              "`trainsformers` is required for `PromptEnhanceAPI`"
          )
      self.tokenizer = GPT2Tokenizer.from_pretrained("distilgpt2")
      self.tokenizer.add_special_tokens({"pad_token": "[PAD]"})
      version = "FredZhang7/distilgpt2-stable-diffusion-v2"
      model = GPT2LMHeadModel.from_pretrained(version)
      self.model = model.half().to(device)
      self.device = device
  
file_path: carefree-learn/cflearn/api/cv/third_party/prompt.py
imports: import torch
  from typing import List
  from typing import NamedTuple
label_desc: Use image node_id 1 to create a new PromptEnhanceAPI object  with example: obj = PromptEnhanceAPI(device)