I am using HuggingFace Transformers with PyTorch. My modus operandi is to download a pre-trained model and save it in a local project folder. While doing so, I can see that .bin file is saved locally, which stands for the model. However, I am also downloading and saving a tokenizer, for which I cannot see any associated file. So, how
Tag: huggingface-transformers
Use huggingface transformers without IPyWidgets
I am trying to use the huggingface transformers library in a hosted Jupyter notebook platform called Deepnote. I want to download a model through the pipeline class but unfortunately deepnote does not support IPyWidgets. Is there a way to disable IPywidgets when using transformers? Specifically the below command. And the error I receive. Note: Installing IPyWidgets is not an option
Does converting a seq2seq NLP model to the ONNX format negatively affect its performance?
I was looking at potentially converting an ml NLP model to the ONNX format in order to take advantage of its speed increase (ONNX Runtime). However, I don’t really understand what is fundamentally changed in the new models compared to the old models. Also, I don’t know if there are any drawbacks. Any thoughts on this would be very appreciated.
Transformers v4.x: Convert slow tokenizer to fast tokenizer
I’m following the transformer’s pretrained model xlm-roberta-large-xnli example and I get the following error I’m using Transformers version ‘4.1.1’ Answer According to Transformers v4.0.0 release, sentencepiece was removed as a required dependency. This means that “The tokenizers that depend on the SentencePiece library will not be available with a standard transformers installation” including the XLMRobertaTokenizer. However, sentencepiece can be installed
How do I interpret my BERT output from Huggingface Transformers for Sequence Classification and tensorflow?
Short TL;DR: I am using BERT for a sequence classification task and don’t understand the output I get. This is my first post, so please bear with me: I am using bert for a sequence classification task with 3 labels. To do this, I am using huggingface transformers with tensorflow, more specifically the TFBertForSequenceClassification class with the bert-base-german-cased model (yes,
BERT DataLoader: Difference between shuffle=True vs Sampler?
I trained a DistilBERT model with DistilBertForTokenClassification on ConLL data fro predicting NER. Training seem to have completed with no problems but I have 2 problems during evaluation phase. I’m getting negative loss value During training, I used shuffle=True for DataLoader. But during evaluation, when I do shuffle=True for DataLoader, I get very poor metric results(f_1, accuracy, recall etc). But
How to use ‘collate_fn’ with dataloaders?
I am trying to train a pretrained roberta model using 3 inputs, 3 input_masks and a label as tensors of my training dataset. I do this using the following code: However this gives me the following error: TypeError: vars() argument must have dict attribute Now I have found out that it is probably because I don’t use collate_fn when using
ValueError: You have to specify either decoder_input_ids or decoder_inputs_embeds
Trying to convert a question-generation t5 model to torchscript model, while doing that Running into this error ValueError: You have to specify either decoder_input_ids or decoder_inputs_embeds here’s the code that I ran on colab. got this error how to resolve this issue? or is there a better way for converting the t5 model to torchscript. thank you. Answer Update: refer