Bils commited on
Commit
89c8e20
·
verified ·
1 Parent(s): bfd456d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -26,7 +26,7 @@ PRIMARY_COLOR = os.environ.get("PRIMARY_COLOR", "#6B5BFF") # UI accent only
26
  MAX_SECS = int(os.environ.get("MAX_SECS", "15")) # keep clips short for ZeroGPU window
27
  TARGET_H = int(os.environ.get("TARGET_H", "480")) # downscale target height
28
  SR = int(os.environ.get("TARGET_SR", "48000")) # WAV sample rate
29
- ZEROGPU_DURATION = int(os.environ.get("ZEROGPU_DURATION", "110")) # <= platform maximum
30
 
31
  def sh(cmd: str):
32
  print(">>", cmd)
@@ -113,13 +113,14 @@ def prepare_once():
113
 
114
  prepare_once()
115
 
116
- # ---- Friendly dependency check (so the error is clear) -----------------------
117
  try:
118
- import audiotools # noqa: F401
119
  except Exception as e:
120
  raise RuntimeError(
121
- "Missing dependency 'audiotools'. "
122
- "Add 'audiotools>=0.7.2' to requirements.txt and restart the Space."
 
123
  ) from e
124
 
125
  # Now safe to import their internals
 
26
  MAX_SECS = int(os.environ.get("MAX_SECS", "15")) # keep clips short for ZeroGPU window
27
  TARGET_H = int(os.environ.get("TARGET_H", "480")) # downscale target height
28
  SR = int(os.environ.get("TARGET_SR", "48000")) # WAV sample rate
29
+ ZEROGPU_DURATION = int(os.environ.get("ZEROGPU_DURATION", "110")) # must be <= platform limit
30
 
31
  def sh(cmd: str):
32
  print(">>", cmd)
 
113
 
114
  prepare_once()
115
 
116
+ # ---- Friendly dependency check (correct package name) ------------------------
117
  try:
118
+ import audiotools # provided by the PyPI package 'descript-audiotools'
119
  except Exception as e:
120
  raise RuntimeError(
121
+ "Missing module 'audiotools'. Install it via the PyPI package "
122
+ "'descript-audiotools' (e.g., add 'descript-audiotools>=0.7.2' "
123
+ "to requirements.txt) and restart the Space."
124
  ) from e
125
 
126
  # Now safe to import their internals