mskov commited on
Commit
c03ca5d
Β·
1 Parent(s): d49d800

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -38,14 +38,17 @@ iface.launch()
38
 
39
  # Evaluate the model
40
  model.eval()
 
41
  with torch.no_grad():
42
  outputs = model(input_ids=input_ids, attention_mask=attention_mask)
 
43
 
44
  # Convert predicted token IDs back to text
45
  predicted_text = tokenizer.batch_decode(outputs.logits.argmax(dim=-1), skip_special_tokens=True)
46
 
47
  # Get ground truth labels from the dataset
48
  labels = dataset["audio"] # Replace "labels" with the appropriate key in your dataset
 
49
 
50
  # Compute WER
51
  wer_score = wer(labels, predicted_text)
 
38
 
39
  # Evaluate the model
40
  model.eval()
41
+ print("model.eval ", model.eval())
42
  with torch.no_grad():
43
  outputs = model(input_ids=input_ids, attention_mask=attention_mask)
44
+ print("outputs ", outputs)
45
 
46
  # Convert predicted token IDs back to text
47
  predicted_text = tokenizer.batch_decode(outputs.logits.argmax(dim=-1), skip_special_tokens=True)
48
 
49
  # Get ground truth labels from the dataset
50
  labels = dataset["audio"] # Replace "labels" with the appropriate key in your dataset
51
+ print("labels are ", labels)
52
 
53
  # Compute WER
54
  wer_score = wer(labels, predicted_text)