versae commited on
Commit
45ac184
1 Parent(s): b9e0a4f

Update eval.py

Browse files
Files changed (1) hide show
  1. eval.py +3 -2
eval.py CHANGED
@@ -13,7 +13,8 @@ def log_results(result: Dataset, args: Dict[str, str]):
13
  """DO NOT CHANGE. This function computes and logs the result metrics."""
14
 
15
  log_outputs = args.log_outputs
16
- dataset_id = "_".join(args.dataset.split("/") + [args.config, args.split])
 
17
 
18
  # load metric
19
  wer = load_metric("wer")
@@ -24,7 +25,7 @@ def log_results(result: Dataset, args: Dict[str, str]):
24
  cer_result = cer.compute(references=result["target"], predictions=result["prediction"])
25
 
26
  # print & log results
27
- result_str = f"WER: {wer_result}\n" f"CER: {cer_result}"
28
  print(result_str)
29
 
30
  with open(f"{dataset_id}_eval_results.txt", "w") as f:
 
13
  """DO NOT CHANGE. This function computes and logs the result metrics."""
14
 
15
  log_outputs = args.log_outputs
16
+ model_id = args.model_id.replace("/", "_").replace(".", "")
17
+ dataset_id = "_".join(args.dataset.split("/") + [model_id, args.config, args.split])
18
 
19
  # load metric
20
  wer = load_metric("wer")
 
25
  cer_result = cer.compute(references=result["target"], predictions=result["prediction"])
26
 
27
  # print & log results
28
+ result_str = f"{dataset_id}\nWER: {wer_result}\nCER: {cer_result}"
29
  print(result_str)
30
 
31
  with open(f"{dataset_id}_eval_results.txt", "w") as f: