cdpierse / cdpierse/transformers-interpret

Text attribution fails for XLM-Roberta models

Open
#123 5 comments 1 reaction 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
1.4k
Forks
99
PR merge metrics
No merged PRs in 30d

Description

### Issue:
I was testing the package on huggingface "xlm-roberta-base" model and it failed with the following error.
`IndexError: index out of range in self`

--------------------------------------------------------------------------------------------------------

### Here's how to reproduce the error:

```
from transformers import AutoTokenizer, AutoModelForSequenceClassification
from transformers_interpret import SequenceClassificationExplainer

tokenizer = AutoTokenizer.from_pretrained("xlm-roberta-base")
model = AutoModelForSequenceClassification.from_pretrained(
"xlm-roberta-base"
)
multiclass_explainer = SequenceClassificationExplainer(model=model, tokenizer=tokenizer)
word_attributions = multiclass_explainer(text="hello world")
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.