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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -5,11 +5,12 @@ import json
5
  import os
6
  import requests
7
  import torch
 
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"
@@ -135,7 +136,11 @@ if uploaded_file:
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
 
5
  import os
6
  import requests
7
  import torch
8
+ import numpy
9
  from datetime import timedelta
10
  from pyannote.audio import Pipeline
11
  from huggingface_hub import hf_hub_download
12
  # Import ALL required classes for Safe Globals whitelisting
13
+ from pyannote.audio.core.task import Specifications, Problem, Resolution
14
 
15
  # --- Configuration & Tokens ---
16
  HARDCODED_HF_TOKEN = "PASTE_YOUR_HF_TOKEN_HERE"
 
136
  torch.serialization.add_safe_globals([
137
  torch.torch_version.TorchVersion,
138
  Specifications,
139
+ Problem,
140
+ Resolution,
141
+ numpy.dtype,
142
+ torch.nn.modules.container.ModuleList,
143
+ numpy.core.multiarray.scalar # Added based on common errors
144
  ])
145
  except AttributeError:
146
  pass