Upload folder using huggingface_hub
Browse files
asr_diarization/pipeline.py
CHANGED
|
@@ -17,6 +17,7 @@ class ASR_Diarization:
|
|
| 17 |
diar_model="pyannote/speaker-diarization-3.1",
|
| 18 |
asr_model="Capstone04/TrainedWhisper"):
|
| 19 |
self.HF_TOKEN = HF_TOKEN
|
|
|
|
| 20 |
self.device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 21 |
|
| 22 |
# Load diarization model
|
|
@@ -27,7 +28,8 @@ class ASR_Diarization:
|
|
| 27 |
"automatic-speech-recognition",
|
| 28 |
model=asr_model,
|
| 29 |
device=0 if self.device == "cuda" else -1,
|
| 30 |
-
return_timestamps=True
|
|
|
|
| 31 |
)
|
| 32 |
|
| 33 |
def run_diarization(self, audio_path):
|
|
|
|
| 17 |
diar_model="pyannote/speaker-diarization-3.1",
|
| 18 |
asr_model="Capstone04/TrainedWhisper"):
|
| 19 |
self.HF_TOKEN = HF_TOKEN
|
| 20 |
+
self.HF_TOKEN1 = HF_TOKEN1
|
| 21 |
self.device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 22 |
|
| 23 |
# Load diarization model
|
|
|
|
| 28 |
"automatic-speech-recognition",
|
| 29 |
model=asr_model,
|
| 30 |
device=0 if self.device == "cuda" else -1,
|
| 31 |
+
return_timestamps=True,
|
| 32 |
+
token=HF_TOKEN1
|
| 33 |
)
|
| 34 |
|
| 35 |
def run_diarization(self, audio_path):
|