Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError on w2v-bert-v2[train] #1

Open
allandclive opened this issue Apr 3, 2024 · 2 comments
Open

ValueError on w2v-bert-v2[train] #1

allandclive opened this issue Apr 3, 2024 · 2 comments

Comments

@allandclive
Copy link

On google colab;
ValueError: Label values must be <= vocab_size: 29

@allandclive
Copy link
Author

`---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
in <cell line: 1>()
----> 1 TRAINER.train() # resume_from_checkpoint=True # only if resume

9 frames
/usr/local/lib/python3.10/dist-packages/transformers/models/wav2vec2_bert/modeling_wav2vec2_bert.py in forward(self, input_features, attention_mask, output_attentions, output_hidden_states, return_dict, labels)
1245 if labels is not None:
1246 if labels.max() >= self.config.vocab_size:
-> 1247 raise ValueError(f"Label values must be <= vocab_size: {self.config.vocab_size}")
1248
1249 # retrieve loss input_lengths from attention_mask

ValueError: Label values must be <= vocab_size: 29`

@phineas-pta
Copy link
Owner

seem like u tried to fine tune for uganda language

in that case i think u should follow the official guide: https://huggingface.co/blog/fine-tune-w2v2-bert

my use case (vietnamese language) is a bit more mainstream so my script is simplified a lot comparing to official guide

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants