question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Restrict model options in transformers examples

See original GitHub issue

In transformers example https://github.com/pytorch/ignite/tree/master/examples/contrib/transformers it’s up to user to override the default model which is bert-base-uncased, a lot of models take similar inputs to BERT and similar outputs too, but models like distilbert-base-uncased, distilroberta-base, bart-base (and many other models) will not work here as they work on a bit different way regarding to the inputs and outputs of the model, check here for more info: https://huggingface.co/transformers/model_doc/distilbert.html#distilbertmodel

So we will get an error similar to this while using DistilBERT

KeyError: 'token_type_ids'

And also if we used something like XLNet that won’t work well and we will have dimensions issue, because XLNet doesn’t return a pooler_output, check here https://huggingface.co/transformers/model_doc/xlnet.html#transformers.XLNetModel

So what we should do is:

  • We don’t provide the option of choosing models, and we just keep BERT, and if the user wants to change the model, he can do that manually
  • Keep it that way and mention in the docs that, the models that can be used here are BERT, RoBERTa (and if there is others we mentions them).

EDIT: After deciding to go with the first option, what we need to do now is to remove model from the argument, and set config['model'] = 'bert-base-uncased' manually inside run method, and mention in the docs we are using BERT by default, and maybe leave a note about if the user wants to try another model, he should that himself.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
vfdev-5commented, Sep 9, 2021

OK for me if you think it could be understandable by other users.

1reaction
KickItLikeShikacommented, Sep 9, 2021

Initially it looks good, what do you think @vfdev-5? if that’s OK, can you try this out please? @Ishan-Kumar2

Read more comments on GitHub >

github_iconTop Results From Across the Web

Summary of the models - Hugging Face
Summary of the models. This is a summary of the models available in Transformers. It assumes you're familiar with the original transformer model....
Read more >
[trainer] a consistent way to limit the number of items #9801
How does one use --max_steps if one needs to use a different number of items for train and eval? Can we have a...
Read more >
Tips and Tricks - Simple Transformers
Task-specific Simple Transformers models each have their own default metrics that will be calculated when a model is evaluated on a dataset. The ......
Read more >
Transformers: Basics, Maintenance, and Diagnostics
common example is boosting 208 V up from one phase of a 120/208-V ... portion of the transformer (i.e., it must prevent hot...
Read more >
Using the Transformers technique in the AWS DeepComposer ...
Model parameter options for the Transformers technique · TopK: The next note is chosen by limiting the list of next available notes based...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found