Skip to content

Error on laion_clap import #171

@vallihalli

Description

@vallihalli

After installation with pip install laion-clap, calling import laion_clap produces following error:
(transformers version 4.30.2)

Traceback (most recent call last):
  File "C:\Users\valli\Desktop\work\VCS\main\project_1_search\clap_test.py", line 1, in <module>
    import laion_clap
  File "C:\Users\valli\.virtualenvs\project_1_search-HY9YXE2J\lib\site-packages\laion_clap\__init__.py", line 5, in <module>
    from .hook import CLAP_Module
  File "C:\Users\valli\.virtualenvs\project_1_search-HY9YXE2J\lib\site-packages\laion_clap\hook.py", line 12, in <module>
    from .training.data import get_audio_features
  File "C:\Users\valli\.virtualenvs\project_1_search-HY9YXE2J\lib\site-packages\laion_clap\training\data.py", line 44, in <module>
    bert_tokenizer = BertTokenizer.from_pretrained("bert-base-uncased")
  File "C:\Users\valli\.virtualenvs\project_1_search-HY9YXE2J\lib\site-packages\transformers\tokenization_utils_base.py", line 1784, in from_pretrained
    resolved_vocab_files[file_id] = cached_file(
  File "C:\Users\valli\.virtualenvs\project_1_search-HY9YXE2J\lib\site-packages\transformers\utils\hub.py", line 433, in cached_file
    raise EnvironmentError(
OSError: bert-base-uncased is not a local folder and is not a valid model identifier listed on 'https://huggingface.co/models'
If this is a private repository, make sure to pass a token having permission to this repo with `use_auth_token` or log in with `huggingface-cli login` and pass `use_auth_token=True`.

After testing, the Error could be resolved by replacing BertTokenizer.from_pretrained("bert-base-uncased") with BertTokenizer.from_pretrained("https://huggingface.co/google-bert/bert-base-uncased") in laion_clap\training\data.py

This error occurs on import, so i assume this isn't expected behaviour, even though i can see BertTokenizer.from_pretrained("bert-base-uncased") beeing used in many other projects as well. So i'm not sure if this is a transformer bug, or a bug in laion_clap, either way i'm not sure how to keep using clap if i cannot import.
Thanks for any help...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions