Skip to content

Commit

Permalink
init features_offset variable for cases where data_length > features_… (
Browse files Browse the repository at this point in the history
#20)

Co-authored-by: Lior Assouline <[email protected]>
  • Loading branch information
alior101 and nsgexo authored Apr 29, 2024
1 parent 332e1b0 commit d0ef708
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions microwakeword/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ def fixed_length_spectrogram(
fixed length spectrogram after truncating or padding
"""
data_length = spectrogram.shape[0]
features_offset = 0
if data_length > features_length:
if truncation_strategy == "random":
features_offset = np.random.randint(0, data_length - features_length)
Expand Down

0 comments on commit d0ef708

Please sign in to comment.