Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix typos BigBird ONNX conversion #16897

Merged
merged 1 commit into from
Apr 25, 2022

Conversation

chainyo
Copy link
Contributor

@chainyo chainyo commented Apr 22, 2022

What does this PR do?

I tried to convert one BigBird model to ONNX with the recent PR merged #16427

But it seems that there is a typo in the src/transformers/onnx/features.py file.
I also fixed the typo in the test_v2 file.

Here is the error I get while trying to convert google/bigbird-roberta-base.

$ python -m transformers.onnx --model=google/bigbird-roberta-base onnx/

> KeyError: "big-bird is not supported yet. 
> Only ['albert', 'bart', 'mbart', 'bert', 'bigbird', 
> 'ibert', 'camembert', 'distilbert', 'flaubert', 'marian', 'm2m-100', 'roberta', 't5', 
> 'xlm-roberta', 'gpt2', 'gptj', 'gpt-neo', 'layoutlm', 'electra', 'vit', 'beit', 'blenderbot', 
> 'blenderbot-small', 'data2vec-text'] are supported. 
> If you want to support big-bird please propose a PR or open up an issue."

As you can see in the error bigbird should be big-bird.

ping @lewtun @LysandreJik

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Apr 22, 2022

The documentation is not available anymore as the PR was closed or merged.

Copy link
Member

@lewtun lewtun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! This error is caused by the fact that the model_type field of BigBird checkpoints is big_bird, which is mapped to big-bird during the ONNX conversion.

@lewtun lewtun merged commit 508baf1 into huggingface:main Apr 25, 2022
elusenji pushed a commit to elusenji/transformers that referenced this pull request Jun 12, 2022
Co-authored-by: ChainYo <t.chaigneau.tc@gmail.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants