Skip to content

Commit 09eb2e6

Browse files
fix(tests): adapt to new version of word expl
1 parent 7e5845a commit 09eb2e6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/test_pipeline.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,17 @@ def run_full_pipeline(tokenizer, sample_text_data, categorical_data, labels, mod
171171
attributions = predictions["attributions"][text_idx]
172172
word_ids = predictions["word_ids"][text_idx]
173173

174-
word_attributions = map_attributions_to_word(attributions, word_ids)
174+
words, word_attributions = map_attributions_to_word(attributions, text, word_ids, offsets)
175175
char_attributions = map_attributions_to_char(attributions, offsets, text)
176176

177177
# Note: We're not actually plotting in tests, just calling the functions
178178
# to ensure they don't raise errors
179179
plot_attributions_at_char(text, char_attributions)
180-
plot_attributions_at_word(text, word_attributions)
180+
plot_attributions_at_word(
181+
text=text,
182+
words=words.values(),
183+
attributions_per_word=word_attributions,
184+
)
181185

182186

183187
def test_wordpiece_tokenizer(sample_data, model_params):

0 commit comments

Comments
 (0)