code: def save_metrics_to_file(wer_file, transducer_metrics, per_metrics):
      with open(wer_file, "w") as w:
          w.write("Transducer loss stats:\n")
          transducer_metrics.write_stats(w)
          w.write("\nPER stats:\n")
          per_metrics.write_stats(w)
          print(
              "Transducer and PER stats written to file",
              hparams["test_wer_file"],
          )
  
file_path: speechbrain/recipes/TIMIT/ASR/transducer/train.py
imports: import os
  import sys
  import logging
  import speechbrain
  from hyperpyyaml import load_hyperpyyaml
  from speechbrain.utils.distributed import run_on_main
label_desc: Use image node_id 1 for calling a global function with example usage: save_metrics_to_file(wer_file, transducer_metrics, per_metrics) without return types