You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
in scripts/run_long_mlm.py the class LongModelForMaskedLM should inherit from MODEL
class LongModelForMaskedLM(MODEL):
def __init__(self, config):
super().__init__(config)
print(f"\n{color.YELLOW}Converting models to Longformer is currently only tested for RoBERTa like architectures.{color.END}")
for i, layer in enumerate(self.roberta.encoder.layer):
layer.attention.self = LongModelSelfAttention(config, layer_id=i)
instead of
class LongModelForMaskedLM():
def __init__(self, config):
super().__init__(config)
print(f"\n{color.YELLOW}Converting models to Longformer is currently only tested for RoBERTa like architectures.{color.END}")
for i, layer in enumerate(self.roberta.encoder.layer):
layer.attention.self = LongModelSelfAttention(config, layer_id=i)
Also I think the regexes in
def is_roberta_based_model(model_name: str) -> str:
"""Validate if the model to pre-train is of roberta architecture."""
if re.search("(?i)(xlm)\D(roberta)", model_name) == 'xlm-roberta':
model_name = 'xlm-roberta'
elif re.search("(?i)(roberta)", model_name) == 'roberta':
model_name = 'roberta'
else:
model_name = 'none'
return model_name
are broken because for 'xlm-roberta-base' the function returns 'none'.
The text was updated successfully, but these errors were encountered:
Hi,
in scripts/run_long_mlm.py the class LongModelForMaskedLM should inherit from MODEL
instead of
Also I think the regexes in
are broken because for 'xlm-roberta-base' the function returns 'none'.
The text was updated successfully, but these errors were encountered: