code: def run(model_name, input_obj, dest_file, from_ckpt, device="cpu"):
      """Loads model from checkpoint or from model name and runs inference on the input_obj.
      Displays results as a pandas DataFrame object.
      If a dest_file is given, it saves the results to a txt file.
      """
      text = load_input_text(input_obj)
      if model_name is not None:
          model = Detoxify(model_name, device=device)
      else:
          model = Detoxify(checkpoint=from_ckpt, device=device)
      res = model.predict(text)
  
      res_df = pd.DataFrame(
          res, index=[text] if isinstance(text, str) else text
      ).round(5)
      print(res_df)
      if dest_file is not None:
          res_df.index.name = "input_text"
          res_df.to_csv(dest_file)
  
      return res
  
imports: import argparse
  import os
  import pandas
  from detoxify import Detoxify
label_desc: Use image node_id 2 for calling a global function with example usage: run(model_name, input_obj, dest_file, from_ckpt, device) and returns: res