class_docstr: Transformer model for machine translation.
class_docstr_tok: ["Transformer","model","for","machine","translation","."]
code: def create_gradio_app(self):
      import gradio as gr
  
      def inference(text):
          results = self.predict(data=[text])
          return results[0]
  
      examples = [["今天是个好日子"]]
  
      interface = gr.Interface(
          inference,
          "text",
          [gr.outputs.Textbox(label="Translation")],
          title="transformer_zh-en",
          examples=examples,
          allow_flagging="never",
      )
  
      return interface
  
imports: import os
  from typing import List
  import paddle
  import paddle.nn
  from paddlenlp.data import Pad
  from paddlenlp.data import Vocab
  from paddlenlp.transformers import InferTransformerModel
  from paddlenlp.transformers import position_encoding_init
  from transformer_zh_en.utils import MTTokenizer
  from transformer_zh_en.utils import post_process_seq
  from paddlehub.env import MODULE_HOME
  from paddlehub.module.module import moduleinfo
  from paddlehub.module.module import serving
label_desc: Use image node_id 6 for calling the MTTransformer obj's underlying member method code with example usage: obj.create_gradio_app() and returns: interface, results