Jedi09 commited on
Commit
1679f10
·
verified ·
1 Parent(s): 10fecdb

Update diarization.py

Browse files
Files changed (1) hide show
  1. diarization.py +4 -7
diarization.py CHANGED
@@ -5,14 +5,11 @@ Pyannote-audio ile konuşmacı ayrımı (kim ne zaman konuşuyor).
5
 
6
  import os
7
  from typing import List, Tuple, Optional
8
- import torch
9
 
10
- # PyTorch 2.6+ compatibility fix for pyannote models
11
- try:
12
- import torch.torch_version
13
- torch.serialization.add_safe_globals([torch.torch_version.TorchVersion])
14
- except (AttributeError, ImportError):
15
- pass # Older PyTorch versions don't need this fix
16
 
17
  # Check for GPU availability
18
  DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu")
 
5
 
6
  import os
7
  from typing import List, Tuple, Optional
 
8
 
9
+ # PyTorch 2.6+ compatibility: Disable weights_only restriction for pyannote models
10
+ os.environ["TORCH_FORCE_NO_WEIGHTS_ONLY_LOAD"] = "1"
11
+
12
+ import torch
 
 
13
 
14
  # Check for GPU availability
15
  DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu")