Skip to content

Error loading the Hubert model #4

@anupsingh15

Description

@anupsingh15

Hi,

I want to extract features from the Hubert model. I am using the following code (as mentioned on fairseq) to load the model:

I downloaded the Hubert model for the hindi language from: https://asr.iitm.ac.in/models

import fairseq

ckpt_path = "SPRING_INX_HuBERT_Hindi.pt"
models, cfg, task = fairseq.checkpoint_utils.load_model_ensemble_and_task([ckpt_path], strict=False)
model = models[0]

However, it throws the following error:

File ~/anaconda_y24/envs/fairseq/lib/python3.9/site-packages/fairseq/data/dictionary.py:236, in Dictionary.add_from_file(self, f)
    [234](https://vscode-remote+ssh-002dremote-002bml3.vscode-resource.vscode-cdn.net/home/anup/anaconda_y24/shell/condabin/temp/Multilingual-STD/~/anaconda_y24/envs/fairseq/lib/python3.9/site-packages/fairseq/data/dictionary.py:234) if isinstance(f, str):
    [235](https://vscode-remote+ssh-002dremote-002bml3.vscode-resource.vscode-cdn.net/home/anup/anaconda_y24/shell/condabin/temp/Multilingual-STD/~/anaconda_y24/envs/fairseq/lib/python3.9/site-packages/fairseq/data/dictionary.py:235)     try:
--> [236](https://vscode-remote+ssh-002dremote-002bml3.vscode-resource.vscode-cdn.net/home/anup/anaconda_y24/shell/condabin/temp/Multilingual-STD/~/anaconda_y24/envs/fairseq/lib/python3.9/site-packages/fairseq/data/dictionary.py:236)         with open(PathManager.get_local_path(f), "r", encoding="utf-8") as fd:
    [237](https://vscode-remote+ssh-002dremote-002bml3.vscode-resource.vscode-cdn.net/home/anup/anaconda_y24/shell/condabin/temp/Multilingual-STD/~/anaconda_y24/envs/fairseq/lib/python3.9/site-packages/fairseq/data/dictionary.py:237)             self.add_from_file(fd)
    [238](https://vscode-remote+ssh-002dremote-002bml3.vscode-resource.vscode-cdn.net/home/anup/anaconda_y24/shell/condabin/temp/Multilingual-STD/~/anaconda_y24/envs/fairseq/lib/python3.9/site-packages/fairseq/data/dictionary.py:238)     except FileNotFoundError as fnfe:

FileNotFoundError: [Errno 2] No such file or directory: '/nlsasfs/home/nltm-pilot/vasistal/feats_hubert/ind_pooled/hub_large_lab/dict.km.txt'

Can you please help in resolving the issue?

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