microsoft / CLAP

Learning audio concepts from natural language supervision
MIT License
455 stars 35 forks source link

error in file structure #20

Closed asad-62 closed 11 months ago

asad-62 commented 11 months ago

In order to extract embeddings, the code
from src import CLAP however there is no module named CLAP in src (see the structure below). Please correct this issue.
. ├── CLAPWrapper.py ├── configs │   └── config.yml ├── esc50_dataset.py ├── feature_extractor.py ├── init.py ├── models │   ├── audio.py │   ├── clap.py │   ├── init.py │   ├── pycache │   │   ├── audio.cpython-39.pyc │   │   ├── clap.cpython-39.pyc │   │   ├── init.cpython-39.pyc │   │   └── utils.cpython-39.pyc │   └── utils.py ├── pycache │   ├── init.cpython-37.pyc │   ├── init.cpython-38.pyc │   └── init.cpython-39.pyc ├── zero_shot_classification.py └── zero_shot_predictions.py

asad-62 commented 11 months ago

Answer : Please change the import like below for it to run

from CLAPWrapper import CLAPWrapper
clap_model = CLAPWrapper("path to weights.pth")

Also make sure to place the main file in src folder

bmartin1 commented 11 months ago

Hi @asad-62,

We recently updated the code, let us know if you have any suggestion to make the code better 🙂.