Feature request: added huggingface functionality checking for token
This commit is contained in:
+3
-1
@@ -1,6 +1,7 @@
|
||||
import gc
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
|
||||
import torch
|
||||
import whisperx
|
||||
@@ -30,6 +31,7 @@ class Transcriber:
|
||||
logger.exception("Failed to initialize models: %s", e)
|
||||
raise
|
||||
self.transcript_output = None
|
||||
self.hf_token = os.environ.get('HF_TOKEN')
|
||||
|
||||
def transcribe(self, wav_filename: str, batch_size: int = 16) -> dict:
|
||||
"""
|
||||
@@ -53,7 +55,7 @@ class Transcriber:
|
||||
self._clear_memory()
|
||||
|
||||
# Run Diarization
|
||||
diarize_model = whisperx.DiarizationPipeline(use_auth_token='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',
|
||||
diarize_model = whisperx.DiarizationPipeline(use_auth_token=self.hf_token,
|
||||
device=self.device)
|
||||
diarize_segments = diarize_model(audio)
|
||||
result = whisperx.assign_word_speakers(diarize_segments, result)
|
||||
|
||||
Reference in New Issue
Block a user