We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I try to plot bert model using this package. But I unable to do it.
Code:
from transformers import AutoModel, AutoTokenizer model = AutoModel.from_pretrained("bert-base-uncased") tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased") inputs = tokenizer("Hello world!", return_tensors="pt")
After that how to plot it?
import hiddenlayer as hl hl.build_graph(model, inputs[0])
The text was updated successfully, but these errors were encountered:
You need to extract input_ids and attention_mask from the tokenizers.Encoding object and pass them as a tuple to the hl.build_graph function.
input_ids
attention_mask
tokenizers.Encoding
hl.build_graph
import hiddenlayer as hl from transformers import AutoModel, AutoTokenizer model = AutoModel.from_pretrained("bert-base-uncased") tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased") inputs = tokenizer("Hello world!", return_tensors="pt") input_ids = inputs["input_ids"] attention_mask = inputs["attention_mask"] hl.build_graph(model, (input_ids, attention_mask))
Sorry, something went wrong.
No branches or pull requests
I try to plot bert model using this package. But I unable to do it.
Code:
After that how to plot it?
The text was updated successfully, but these errors were encountered: