Spaces:
Running
Running
Update soni_translate/mdx_net.py
Browse files- soni_translate/mdx_net.py +12 -0
soni_translate/mdx_net.py
CHANGED
@@ -367,6 +367,18 @@ def run_mdx(
|
|
367 |
processor_num = -1
|
368 |
m_threads = 1
|
369 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
370 |
model_hash = MDX.get_hash(model_path)
|
371 |
mp = model_params.get(model_hash)
|
372 |
model = MDXModel(
|
|
|
367 |
processor_num = -1
|
368 |
m_threads = 1
|
369 |
|
370 |
+
if os.environ.get("ZERO_GPU") == "TRUE":
|
371 |
+
duration = librosa.get_duration(filename=filename)
|
372 |
+
|
373 |
+
if duration < 60:
|
374 |
+
pass
|
375 |
+
elif duration >= 60 and duration <= 900:
|
376 |
+
m_threads = 4
|
377 |
+
elif duration > 900:
|
378 |
+
m_threads = 16
|
379 |
+
|
380 |
+
logger.info(f"MDX-NET Threads: {m_threads}, duration {duration}")
|
381 |
+
|
382 |
model_hash = MDX.get_hash(model_path)
|
383 |
mp = model_params.get(model_hash)
|
384 |
model = MDXModel(
|