NickVerri commited on
Commit
fd3fa7c
·
verified ·
1 Parent(s): f931a0b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
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
- from pyannote.audio.core.task import Specifications # Import required for Safe Globals
 
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([torch.torch_version.TorchVersion, Specifications])
 
 
 
 
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