mirror of
https://github.com/YuzuZensai/spleeter.git
synced 2026-01-06 04:32:43 +00:00
🐛 fix AUTO backend support
This commit is contained in:
@@ -37,7 +37,7 @@ from typer import Exit, Typer
|
||||
# pylint: enable=import-error
|
||||
|
||||
spleeter: Typer = Typer()
|
||||
""" """
|
||||
""" CLI application. """
|
||||
|
||||
|
||||
@spleeter.command()
|
||||
|
||||
@@ -333,6 +333,11 @@ class Separator(object):
|
||||
(Optional) string describing the waveform (e.g. filename).
|
||||
"""
|
||||
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:
|
||||
return self._separate_tensorflow(waveform, audio_descriptor)
|
||||
elif backend == STFTBackend.LIBROSA:
|
||||
|
||||
@@ -93,7 +93,7 @@ def test_train():
|
||||
TRAIN_CONFIG['model_dir'] = join(path, 'model')
|
||||
TRAIN_CONFIG['training_cache'] = join(path, 'cache', 'training')
|
||||
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)
|
||||
# execute training
|
||||
result = runner.invoke(spleeter, [
|
||||
|
||||
Reference in New Issue
Block a user