carlosdanielhernandezmena commited on
Commit
6bef571
1 Parent(s): 3b9ee33

Updating the evaluation code. load_metric is deprecated using load from evaluate instead.

Browse files
Files changed (1) hide show
  1. README.md +3 -2
README.md CHANGED
@@ -62,7 +62,7 @@ processor = Wav2Vec2Processor.from_pretrained(MODEL_NAME)
62
  model = Wav2Vec2ForCTC.from_pretrained(MODEL_NAME)
63
 
64
  #Load the dataset
65
- from datasets import load_dataset, load_metric, Audio
66
  ds=load_dataset("carlosdanielhernandezmena/ravnursson_asr",split='test')
67
 
68
  #Downsample to 16kHz
@@ -80,7 +80,8 @@ ds = ds.map(prepare_dataset, remove_columns=ds.column_names,num_proc=1)
80
 
81
  #Define the evaluation metric
82
  import numpy as np
83
- wer_metric = load_metric("wer")
 
84
  def compute_metrics(pred):
85
  pred_logits = pred.predictions
86
  pred_ids = np.argmax(pred_logits, axis=-1)
 
62
  model = Wav2Vec2ForCTC.from_pretrained(MODEL_NAME)
63
 
64
  #Load the dataset
65
+ from datasets import load_dataset, Audio
66
  ds=load_dataset("carlosdanielhernandezmena/ravnursson_asr",split='test')
67
 
68
  #Downsample to 16kHz
 
80
 
81
  #Define the evaluation metric
82
  import numpy as np
83
+ from evaluate import load
84
+ wer_metric = load("wer")
85
  def compute_metrics(pred):
86
  pred_logits = pred.predictions
87
  pred_ids = np.argmax(pred_logits, axis=-1)