Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,7 +8,8 @@ import torch
|
|
| 8 |
from datetime import timedelta
|
| 9 |
from pyannote.audio import Pipeline
|
| 10 |
from huggingface_hub import hf_hub_download
|
| 11 |
-
|
|
|
|
| 12 |
|
| 13 |
# --- Configuration & Tokens ---
|
| 14 |
HARDCODED_HF_TOKEN = "PASTE_YOUR_HF_TOKEN_HERE"
|
|
@@ -129,9 +130,13 @@ if uploaded_file:
|
|
| 129 |
|
| 130 |
# 1. Diarization with Manual Config Loading
|
| 131 |
try:
|
| 132 |
-
# Fix for PyTorch 2.6+ security
|
| 133 |
try:
|
| 134 |
-
torch.serialization.add_safe_globals([
|
|
|
|
|
|
|
|
|
|
|
|
|
| 135 |
except AttributeError:
|
| 136 |
pass
|
| 137 |
|
|
|
|
| 8 |
from datetime import timedelta
|
| 9 |
from pyannote.audio import Pipeline
|
| 10 |
from huggingface_hub import hf_hub_download
|
| 11 |
+
# Import ALL required classes for Safe Globals whitelisting
|
| 12 |
+
from pyannote.audio.core.task import Specifications, Problem
|
| 13 |
|
| 14 |
# --- Configuration & Tokens ---
|
| 15 |
HARDCODED_HF_TOKEN = "PASTE_YOUR_HF_TOKEN_HERE"
|
|
|
|
| 130 |
|
| 131 |
# 1. Diarization with Manual Config Loading
|
| 132 |
try:
|
| 133 |
+
# Fix for PyTorch 2.6+ security - whitelist ALL necessary classes
|
| 134 |
try:
|
| 135 |
+
torch.serialization.add_safe_globals([
|
| 136 |
+
torch.torch_version.TorchVersion,
|
| 137 |
+
Specifications,
|
| 138 |
+
Problem # Required to fix 'Problem was not an allowed global'
|
| 139 |
+
])
|
| 140 |
except AttributeError:
|
| 141 |
pass
|
| 142 |
|