Skip to content

Commit

Permalink
Fix for torch import error
Browse files Browse the repository at this point in the history
  • Loading branch information
mmcauliffe committed Sep 29, 2024
1 parent 95fb7dc commit 1921766
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion montreal_forced_aligner/online/transcription.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import typing

import numpy as np
import torch
from _kalpy.fstext import ConstFst
from _kalpy.matrix import DoubleMatrix, FloatMatrix
from kalpy.data import Segment
Expand Down Expand Up @@ -129,6 +128,8 @@ def transcribe_utterance_online_speechbrain(
raise Exception(
"Could not import speechbrain, please ensure it is installed via `pip install speechbrain`"
)
import torch

segment = utterance.segment
waveform = segment.load_audio()
waveform = model.audio_normalizer(waveform, 16000).unsqueeze(0)
Expand Down

0 comments on commit 1921766

Please sign in to comment.