Spaces:
Runtime error
Runtime error
%%javascript | |
require.config({ | |
paths: { | |
d3: '//cdnjs.cloudflare.com/ajax/libs/d3/3.4.8/d3.min', | |
jquery: '//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min', | |
} | |
}); | |
from transformers import AutoTokenizer | |
from bertviz.transformers_neuron_view import BertModel | |
from bertviz.neuron_view import show | |
model_ckpt = "bert-base-uncased" | |
tokenizer = AutoTokenizer.from_pretrained(model_ckpt) | |
model = BertModel.from_pretrained(model_ckpt) | |
text = "time flies like an arrow" | |
show(model, "bert", tokenizer, text, display_mode="light", layer=0, head=8) |