Prueba
Browse files- audio_pipeline.py +8 -8
audio_pipeline.py
CHANGED
|
@@ -1,16 +1,16 @@
|
|
| 1 |
-
# audio_pipeline.py
|
| 2 |
-
|
| 3 |
import os
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
import librosa
|
| 5 |
import numpy as np
|
| 6 |
import soundfile as sf
|
| 7 |
import noisereduce as nr
|
| 8 |
-
import httpx
|
| 9 |
-
|
| 10 |
-
# Monkey-patch para que Spleeter siga redirecciones al descargar el modelo
|
| 11 |
-
from spleeter.model.provider.github import GitHubProvider
|
| 12 |
-
GitHubProvider.client = httpx.Client(follow_redirects=True)
|
| 13 |
-
|
| 14 |
from spleeter.separator import Separator
|
| 15 |
|
| 16 |
# Directorio base donde guardaremos todos los stems
|
|
|
|
|
|
|
|
|
|
| 1 |
import os
|
| 2 |
+
import httpx
|
| 3 |
+
# Patch httpx.Client to follow redirects by default (fix Github 302 issue)
|
| 4 |
+
orig_init = httpx.Client.__init__
|
| 5 |
+
def patched_init(self, *args, **kwargs):
|
| 6 |
+
kwargs.setdefault('follow_redirects', True)
|
| 7 |
+
return orig_init(self, *args, **kwargs)
|
| 8 |
+
httpx.Client.__init__ = patched_init
|
| 9 |
+
|
| 10 |
import librosa
|
| 11 |
import numpy as np
|
| 12 |
import soundfile as sf
|
| 13 |
import noisereduce as nr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
from spleeter.separator import Separator
|
| 15 |
|
| 16 |
# Directorio base donde guardaremos todos los stems
|