Spaces:
Build error
Build error
Auth
Browse files- diarization.py +4 -2
diarization.py
CHANGED
|
@@ -5,9 +5,11 @@ import re
|
|
| 5 |
import torch
|
| 6 |
|
| 7 |
def perform_diarization(audio_file_path, translated_file_path, output_dir='./audio/diarization'):
|
| 8 |
-
# Initialize diarization pipeline
|
| 9 |
-
pipeline = Pipeline.from_pretrained("pyannote/speaker-diarization-3.1", use_auth_token='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')
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
# Send pipeline to GPU (when available)
|
| 12 |
pipeline.to(torch.device("cuda" if torch.cuda.is_available() else "cpu"))
|
| 13 |
|
|
|
|
| 5 |
import torch
|
| 6 |
|
| 7 |
def perform_diarization(audio_file_path, translated_file_path, output_dir='./audio/diarization'):
|
|
|
|
|
|
|
| 8 |
|
| 9 |
+
# Initialize diarization pipeline
|
| 10 |
+
accesstoken = os.environ['Diarization']
|
| 11 |
+
pipeline = Pipeline.from_pretrained("pyannote/speaker-diarization-3.1", token=accesstoken )
|
| 12 |
+
|
| 13 |
# Send pipeline to GPU (when available)
|
| 14 |
pipeline.to(torch.device("cuda" if torch.cuda.is_available() else "cpu"))
|
| 15 |
|