Upload folder using huggingface_hub
Browse files
asr_diarization/pipeline.py
CHANGED
|
@@ -5,7 +5,6 @@ import torchaudio
|
|
| 5 |
import noisereduce as nr
|
| 6 |
from pyannote.audio import Pipeline
|
| 7 |
from transformers import pipeline as hf_pipeline
|
| 8 |
-
from transformers import WhisperForConditionalGeneration, WhisperProcessor
|
| 9 |
import tempfile
|
| 10 |
|
| 11 |
from pyannote.core import Annotation, Segment
|
|
@@ -26,7 +25,7 @@ class ASR_Diarization:
|
|
| 26 |
# Load ASR model with timestamps
|
| 27 |
self.asr_pipeline = hf_pipeline(
|
| 28 |
"automatic-speech-recognition",
|
| 29 |
-
model=
|
| 30 |
device=0 if self.device == "cuda" else -1,
|
| 31 |
return_timestamps=True
|
| 32 |
)
|
|
|
|
| 5 |
import noisereduce as nr
|
| 6 |
from pyannote.audio import Pipeline
|
| 7 |
from transformers import pipeline as hf_pipeline
|
|
|
|
| 8 |
import tempfile
|
| 9 |
|
| 10 |
from pyannote.core import Annotation, Segment
|
|
|
|
| 25 |
# Load ASR model with timestamps
|
| 26 |
self.asr_pipeline = hf_pipeline(
|
| 27 |
"automatic-speech-recognition",
|
| 28 |
+
model=asr_model,
|
| 29 |
device=0 if self.device == "cuda" else -1,
|
| 30 |
return_timestamps=True
|
| 31 |
)
|