Claude commited on
Commit ·
e1e3c3a
1
Parent(s): c084bdc
Pin torch/torchvision/torchaudio to 2.2.2 trio for pyannote 3.4.0 compat (reverts the AudioMetaData shim, which didn't find the class)
Browse files- app.py +0 -28
- requirements.txt +3 -2
app.py
CHANGED
|
@@ -156,34 +156,6 @@ def _get_diar_pipe():
|
|
| 156 |
if _diar_pipe is not None:
|
| 157 |
return _diar_pipe
|
| 158 |
import os
|
| 159 |
-
import torchaudio
|
| 160 |
-
|
| 161 |
-
# Compat shim: pyannote.audio 3.4.0 expects `torchaudio.AudioMetaData` at
|
| 162 |
-
# the top level (true in torchaudio 2.2.x). Newer torchaudio releases
|
| 163 |
-
# dropped that re-export even though the underlying class still exists.
|
| 164 |
-
# Reattach it from wherever it actually lives, without touching the
|
| 165 |
-
# installed torch/torchaudio versions (which the image/video generation
|
| 166 |
-
# tabs on this Space depend on).
|
| 167 |
-
if not hasattr(torchaudio, "AudioMetaData"):
|
| 168 |
-
_meta_cls = None
|
| 169 |
-
for _modpath in (
|
| 170 |
-
"torchaudio._backend.common",
|
| 171 |
-
"torchaudio.backend.common",
|
| 172 |
-
"torchaudio.io",
|
| 173 |
-
):
|
| 174 |
-
try:
|
| 175 |
-
_mod = __import__(_modpath, fromlist=["AudioMetaData"])
|
| 176 |
-
_meta_cls = getattr(_mod, "AudioMetaData", None)
|
| 177 |
-
if _meta_cls is not None:
|
| 178 |
-
break
|
| 179 |
-
except ImportError:
|
| 180 |
-
continue
|
| 181 |
-
if _meta_cls is not None:
|
| 182 |
-
torchaudio.AudioMetaData = _meta_cls
|
| 183 |
-
print(f"Shimmed torchaudio.AudioMetaData from {_modpath}", flush=True)
|
| 184 |
-
else:
|
| 185 |
-
print("WARN: could not find AudioMetaData to shim onto torchaudio", flush=True)
|
| 186 |
-
|
| 187 |
from pyannote.audio import Pipeline as DiarPipeline
|
| 188 |
|
| 189 |
token = os.environ.get("HF_TOKEN")
|
|
|
|
| 156 |
if _diar_pipe is not None:
|
| 157 |
return _diar_pipe
|
| 158 |
import os
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 159 |
from pyannote.audio import Pipeline as DiarPipeline
|
| 160 |
|
| 161 |
token = os.environ.get("HF_TOKEN")
|
requirements.txt
CHANGED
|
@@ -6,8 +6,9 @@ Pillow>=10.0
|
|
| 6 |
scipy>=1.11
|
| 7 |
imageio>=2.34
|
| 8 |
imageio-ffmpeg>=0.5
|
| 9 |
-
torch
|
| 10 |
-
torchvision
|
|
|
|
| 11 |
diffusers>=0.38.0
|
| 12 |
transformers>=4.40
|
| 13 |
accelerate>=0.30
|
|
|
|
| 6 |
scipy>=1.11
|
| 7 |
imageio>=2.34
|
| 8 |
imageio-ffmpeg>=0.5
|
| 9 |
+
torch==2.2.2
|
| 10 |
+
torchvision==0.17.2
|
| 11 |
+
torchaudio==2.2.2
|
| 12 |
diffusers>=0.38.0
|
| 13 |
transformers>=4.40
|
| 14 |
accelerate>=0.30
|