diff --git a/nn_fingerprint.py b/nn_fingerprint.py index 44e8dc9..1cf86b3 100644 --- a/nn_fingerprint.py +++ b/nn_fingerprint.py @@ -28,7 +28,12 @@ from towhee import register from towhee.types.audio_frame import AudioFrame from towhee.models.nnfp import NNFp from towhee.models.utils.audio_preprocess import preprocess_wav, MelSpec -# from towhee.dc2 import accelerate + +try: + from towhee import accelerate +except: + def accelerate(func): + return func from .configs import default_params, hop25_params, distill_params @@ -81,6 +86,7 @@ class NNFingerprint(NNOperator): """ Audio embedding operator using Neural Network Fingerprint """ + def __init__(self, model_name: str = 'nnfp_default', model_path: str = None,