mirror of
https://github.com/YuzuZensai/spleeter.git
synced 2026-01-30 20:24:31 +00:00
🐛 fix AUTO backend support
This commit is contained in:
@@ -37,7 +37,7 @@ from typer import Exit, Typer
|
|||||||
# pylint: enable=import-error
|
# pylint: enable=import-error
|
||||||
|
|
||||||
spleeter: Typer = Typer()
|
spleeter: Typer = Typer()
|
||||||
""" """
|
""" CLI application. """
|
||||||
|
|
||||||
|
|
||||||
@spleeter.command()
|
@spleeter.command()
|
||||||
|
|||||||
@@ -333,6 +333,11 @@ class Separator(object):
|
|||||||
(Optional) string describing the waveform (e.g. filename).
|
(Optional) string describing the waveform (e.g. filename).
|
||||||
"""
|
"""
|
||||||
backend: str = self._params['stft_backend']
|
backend: str = self._params['stft_backend']
|
||||||
|
if backend == STFTBackend.AUTO:
|
||||||
|
if len(tf.config.list_physical_devices('GPU')):
|
||||||
|
backend = STFTBackend.TENSORFLOW
|
||||||
|
else:
|
||||||
|
backend = STFTBackend.LIBROSA
|
||||||
if backend == STFTBackend.TENSORFLOW:
|
if backend == STFTBackend.TENSORFLOW:
|
||||||
return self._separate_tensorflow(waveform, audio_descriptor)
|
return self._separate_tensorflow(waveform, audio_descriptor)
|
||||||
elif backend == STFTBackend.LIBROSA:
|
elif backend == STFTBackend.LIBROSA:
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ def test_train():
|
|||||||
TRAIN_CONFIG['model_dir'] = join(path, 'model')
|
TRAIN_CONFIG['model_dir'] = join(path, 'model')
|
||||||
TRAIN_CONFIG['training_cache'] = join(path, 'cache', 'training')
|
TRAIN_CONFIG['training_cache'] = join(path, 'cache', 'training')
|
||||||
TRAIN_CONFIG['validation_cache'] = join(path, 'cache', 'validation')
|
TRAIN_CONFIG['validation_cache'] = join(path, 'cache', 'validation')
|
||||||
with open('useless_config.json') as stream:
|
with open('useless_config.json', 'w') as stream:
|
||||||
json.dump(TRAIN_CONFIG, stream)
|
json.dump(TRAIN_CONFIG, stream)
|
||||||
# execute training
|
# execute training
|
||||||
result = runner.invoke(spleeter, [
|
result = runner.invoke(spleeter, [
|
||||||
|
|||||||
Reference in New Issue
Block a user