test
Browse files
run_flax_speech_recognition_seq2seq_streaming.py
CHANGED
|
@@ -717,8 +717,8 @@ def main():
|
|
| 717 |
# We have also considered adding it to Tensorboard logs instead, but it is not so easily browsable.
|
| 718 |
# We do howver think it is extemely useful info for debugging and improving the model
|
| 719 |
|
| 720 |
-
def write_predictions(step,eval_metrics, pred_ids, label_ids
|
| 721 |
-
predictions_folder_name = os.path.join(
|
| 722 |
eval_table = f"| STEP| loss | wer |cer|\n| ---| --- | --- |--- |\n| **{step}**| {eval_metrics['loss']:.3f} | {eval_metrics['wer']:.3f} |{eval_metrics['cer']:.3f} |"
|
| 723 |
|
| 724 |
# Put all predictions into a table and calculate wer
|
|
@@ -1067,7 +1067,7 @@ def main():
|
|
| 1067 |
eval_metrics, train_time, step)
|
| 1068 |
|
| 1069 |
if training_args.predict_with_generate and write_predictions:
|
| 1070 |
-
write_predictions(step,eval_metrics, eval_preds, eval_labels
|
| 1071 |
|
| 1072 |
# save checkpoint after each epoch and push checkpoint to the hub
|
| 1073 |
if jax.process_index() == 0:
|
|
|
|
| 717 |
# We have also considered adding it to Tensorboard logs instead, but it is not so easily browsable.
|
| 718 |
# We do howver think it is extemely useful info for debugging and improving the model
|
| 719 |
|
| 720 |
+
def write_predictions(step,eval_metrics, pred_ids, label_ids):
|
| 721 |
+
predictions_folder_name = os.path.join(training_args.output_dir,"/predictions")
|
| 722 |
eval_table = f"| STEP| loss | wer |cer|\n| ---| --- | --- |--- |\n| **{step}**| {eval_metrics['loss']:.3f} | {eval_metrics['wer']:.3f} |{eval_metrics['cer']:.3f} |"
|
| 723 |
|
| 724 |
# Put all predictions into a table and calculate wer
|
|
|
|
| 1067 |
eval_metrics, train_time, step)
|
| 1068 |
|
| 1069 |
if training_args.predict_with_generate and write_predictions:
|
| 1070 |
+
write_predictions(step,eval_metrics, eval_preds, eval_labels)
|
| 1071 |
|
| 1072 |
# save checkpoint after each epoch and push checkpoint to the hub
|
| 1073 |
if jax.process_index() == 0:
|