Merge pull request #28 from microsoft/bmartin1_update_examples
Removed weights_path parameter
This commit is contained in:
@@ -4,8 +4,7 @@ This is an example using CLAPCAP for audio captioning.
|
|||||||
from msclap import CLAP
|
from msclap import CLAP
|
||||||
|
|
||||||
# Load and initialize CLAP
|
# Load and initialize CLAP
|
||||||
weights_path = "weights_path"
|
clap_model = CLAP(version = 'clapcap', use_cuda=False)
|
||||||
clap_model = CLAP(weights_path, version = 'clapcap', use_cuda=False)
|
|
||||||
|
|
||||||
#Load audio files
|
#Load audio files
|
||||||
audio_files = ['audio_file']
|
audio_files = ['audio_file']
|
||||||
|
|||||||
@@ -17,8 +17,7 @@ prompt = 'this is the sound of '
|
|||||||
y = [prompt + x for x in dataset.classes]
|
y = [prompt + x for x in dataset.classes]
|
||||||
|
|
||||||
# Load and initialize CLAP
|
# Load and initialize CLAP
|
||||||
weights_path = "weights_path"
|
clap_model = CLAP(version = '2023', use_cuda=False)
|
||||||
clap_model = CLAP(weights_path, version = '2023', use_cuda=False)
|
|
||||||
|
|
||||||
# Computing text embeddings
|
# Computing text embeddings
|
||||||
text_embeddings = clap_model.get_text_embeddings(y)
|
text_embeddings = clap_model.get_text_embeddings(y)
|
||||||
|
|||||||
@@ -15,9 +15,8 @@ class_prompts = [prompt + x for x in classes]
|
|||||||
audio_files = ['audio_file']
|
audio_files = ['audio_file']
|
||||||
|
|
||||||
# Load and initialize CLAP
|
# Load and initialize CLAP
|
||||||
weights_path = "weights_path"
|
|
||||||
# Setting use_cuda = True will load the model on a GPU using CUDA
|
# Setting use_cuda = True will load the model on a GPU using CUDA
|
||||||
clap_model = CLAP(weights_path, version = '2023', use_cuda=False)
|
clap_model = CLAP(version = '2023', use_cuda=False)
|
||||||
|
|
||||||
# compute text embeddings from natural text
|
# compute text embeddings from natural text
|
||||||
text_embeddings = clap_model.get_text_embeddings(class_prompts)
|
text_embeddings = clap_model.get_text_embeddings(class_prompts)
|
||||||
|
|||||||
Reference in New Issue
Block a user