mirror of
https://github.com/ml-explore/mlx-examples.git
synced 2025-06-24 17:31:18 +08:00
gpu featurization (#824)
This commit is contained in:
parent
4872727f14
commit
c5da302fc4
@ -151,8 +151,6 @@ def log_mel_spectrogram(
|
||||
mx.array, shape = (80, n_frames)
|
||||
An array that contains the Mel spectrogram
|
||||
"""
|
||||
device = mx.default_device()
|
||||
mx.set_default_device(mx.cpu)
|
||||
if isinstance(audio, str):
|
||||
audio = load_audio(audio)
|
||||
elif not isinstance(audio, mx.array):
|
||||
@ -170,5 +168,4 @@ def log_mel_spectrogram(
|
||||
log_spec = mx.maximum(mel_spec, 1e-10).log10()
|
||||
log_spec = mx.maximum(log_spec, log_spec.max() - 8.0)
|
||||
log_spec = (log_spec + 4.0) / 4.0
|
||||
mx.set_default_device(device)
|
||||
return log_spec
|
||||
|
Loading…
Reference in New Issue
Block a user