mazesmazes commited on
Commit
4b3a27a
·
verified ·
1 Parent(s): e709a58

Update custom model files, README, and requirements

Browse files
Files changed (1) hide show
  1. alignment.py +4 -4
alignment.py CHANGED
@@ -4,9 +4,9 @@ import numpy as np
4
  import torch
5
 
6
  # Offset compensation for Wav2Vec2-BASE systematic bias (in seconds)
7
- # Calibrated on librispeech-alignments dataset
8
- START_OFFSET = 0.06 # Subtract from start times (shift earlier)
9
- END_OFFSET = -0.03 # Add to end times (shift later)
10
 
11
 
12
  def _get_device() -> str:
@@ -254,7 +254,7 @@ class ForcedAligner:
254
  word_idx = 0
255
  separator_id = dictionary.get("|", dictionary.get(" ", 0))
256
 
257
- for token_id, start_frame, end_frame, peak_frame in alignment_path:
258
  if token_id == separator_id: # Word separator
259
  if (
260
  first_char_peak is not None
 
4
  import torch
5
 
6
  # Offset compensation for Wav2Vec2-BASE systematic bias (in seconds)
7
+ # Calibrated on librispeech-alignments dataset (n=25, Median AE=20ms)
8
+ START_OFFSET = 0.03 # Subtract from start times (shift earlier)
9
+ END_OFFSET = -0.03 # Subtract from end times (shift earlier)
10
 
11
 
12
  def _get_device() -> str:
 
254
  word_idx = 0
255
  separator_id = dictionary.get("|", dictionary.get(" ", 0))
256
 
257
+ for token_id, _start_frame, _end_frame, peak_frame in alignment_path:
258
  if token_id == separator_id: # Word separator
259
  if (
260
  first_char_peak is not None