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

add roberta support #1503

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

BunnyNoBugs
Copy link

Add RoBERTa support in squad_torch_bert config.

The changes concern the shape of token_type_ids specific for RoBERTa

@@ -184,7 +184,9 @@ def __call__(self, features: List[InputFeatures]) -> Tuple[List[int], List[int],
b_input_ids = torch.cat(input_ids, dim=0).to(self.device)
b_input_masks = torch.cat(input_masks, dim=0).to(self.device)
b_input_type_ids = torch.cat(input_type_ids, dim=0).to(self.device)

if self.pretrained_bert == 'roberta-base':
Copy link
Contributor

Choose a reason for hiding this comment

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

it seems like we should generalize this condition (not only to roberta-base)

Copy link
Author

Choose a reason for hiding this comment

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

updated

@BunnyNoBugs
Copy link
Author

Now distilbert, roberta, xlm, bart and longformer-like models can be trained correctly (confirmed on a GPU)

@IgnatovFedor IgnatovFedor changed the base branch from master to dev April 6, 2022 15:00
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

Successfully merging this pull request may close these issues.

2 participants