class_docstr: Save the result of inference.
docstr: main func entrypoint
docstr_tok: ["main","func","entrypoint"]
code: def call(self, predictions, log_verbose=False):
      """main func entrypoint"""
      preds = predictions["preds"]
  
      res_file = self.config["solver"]["postproc"].get("res_file", "")
      if res_file == "":
          logging.info(
              "Infer res not saved. You can check 'res_file' in your config."
          )
          return
      res_dir = os.path.dirname(res_file)
      if not os.path.exists(res_dir):
          os.makedirs(res_dir)
      logging.info("Save inference result to: {}".format(res_file))
      self.task_config = self.config["data"]["task"]
      self.label_vocab_file_paths = self.task_config["label_vocab"]
      if not isinstance(self.label_vocab_file_paths, list):
          self.label_vocab_file_paths = [self.label_vocab_file_paths]
      self.use_label_vocab = self.task_config["use_label_vocab"]
      if self.use_label_vocab:
          label_path_file = self.label_vocab_file_paths[0]
      else:
          label_path_file = self.task_config["text_vocab"]
      preds = ids_to_sentences(preds, label_path_file)
      with open(res_file, "w", encoding="utf-8") as in_f:
          for i, pre in enumerate(preds):
              while len(pre) > 1 and pre[-1] in [
                  "<unk>",
                  "<pad>",
                  "<eos>",
              ]:
                  pre.pop()
              pred_abs = " ".join(pre)
              in_f.write(pred_abs)
              in_f.write("\n")
  
file_path: delta/delta/utils/postprocess/text_seq2seq_proc.py
imports: import os
  import numpy
  from absl import logging
  from delta.utils.postprocess.base_postproc import PostProc
  from delta.utils.register import registers
  from delta.utils.postprocess.postprocess_utils import ids_to_sentences
label_desc: Use image node_id 1 for calling the SavePredSeqPostProc obj's underlying member method code with example usage: obj.call(predictions, log_verbose) without return types