From bb3bfb4e5bf9bc556beb6cef2300f5cfe68949a4 Mon Sep 17 00:00:00 2001 From: Azalea <22280294+hykilpikonna@users.noreply.github.com> Date: Wed, 11 Oct 2023 19:55:08 -0400 Subject: [PATCH] [F] Fix examples --- examples/audio_captioning.py | 4 ++-- examples/zero_shot_classification.py | 4 ++-- examples/zero_shot_predictions.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/audio_captioning.py b/examples/audio_captioning.py index fded5c2..e1c78f1 100644 --- a/examples/audio_captioning.py +++ b/examples/audio_captioning.py @@ -1,11 +1,11 @@ """ This is an example using CLAPCAP for audio captioning. """ -from CLAPWrapper import CLAPWrapper +from msclap import CLAP # Load and initialize CLAP weights_path = "weights_path" -clap_model = CLAPWrapper(weights_path, version = 'clapcap', use_cuda=False) +clap_model = CLAP(weights_path, version = 'clapcap', use_cuda=False) #Load audio files audio_files = ['audio_file'] diff --git a/examples/zero_shot_classification.py b/examples/zero_shot_classification.py index 64c4ed2..e845ce8 100644 --- a/examples/zero_shot_classification.py +++ b/examples/zero_shot_classification.py @@ -3,7 +3,7 @@ This is an example using CLAP to perform zeroshot classification on ESC50 (https://github.com/karolpiczak/ESC-50). """ -from CLAPWrapper import CLAPWrapper +from msclap import CLAP from esc50_dataset import ESC50 import torch.nn.functional as F import numpy as np @@ -18,7 +18,7 @@ y = [prompt + x for x in dataset.classes] # Load and initialize CLAP weights_path = "weights_path" -clap_model = CLAPWrapper(weights_path, version = '2023', use_cuda=False) +clap_model = CLAP(weights_path, version = '2023', use_cuda=False) # Computing text embeddings text_embeddings = clap_model.get_text_embeddings(y) diff --git a/examples/zero_shot_predictions.py b/examples/zero_shot_predictions.py index da8197d..45b53e9 100644 --- a/examples/zero_shot_predictions.py +++ b/examples/zero_shot_predictions.py @@ -1,7 +1,7 @@ """ This is an example using CLAP for zero-shot inference. """ -from CLAPWrapper import CLAPWrapper +from msclap import CLAP import torch.nn.functional as F # Define classes for zero-shot @@ -17,7 +17,7 @@ audio_files = ['audio_file'] # Load and initialize CLAP weights_path = "weights_path" # Setting use_cuda = True will load the model on a GPU using CUDA -clap_model = CLAPWrapper(weights_path, version = '2023', use_cuda=False) +clap_model = CLAP(weights_path, version = '2023', use_cuda=False) # compute text embeddings from natural text text_embeddings = clap_model.get_text_embeddings(class_prompts)