Skip to content

Commit 0029797

Browse files
authored
hubert load_audio
1 parent a77e8e6 commit 0029797

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

hubert/inference.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,16 @@
33
import numpy as np
44
import argparse
55
import torch
6+
import librosa
67

7-
from whisper.audio import load_audio
88
from hubert import hubert_model
99

1010

11+
def load_audio(file: str, sr: int = 16000):
12+
x, sr = librosa.load(file, sr=sr)
13+
return x
14+
15+
1116
def load_model(path, device):
1217
model = hubert_model.hubert_soft(path)
1318
model.eval()

0 commit comments

Comments
 (0)