Based on the Pytorch-Transformers library by HuggingFace. To be used as a starting point for employing Transformer models in text classification tasks. Contains code to easily train BERT, XLNet, RoBERTa, and XLM models for text classification.
Apache License 2.0
306
stars
97
forks
source link
AttributeError: module 'torch.nn.functional' has no attribute 'one_hot' #27
This may be caused by an update to the Hugging Face Transformers library. Please consider using Simple Transformers as this repo may not be compatible with the current Hugging Face library.
if args['do_train']: train_dataset = load_and_cache_examples(task, tokenizer) global_step, tr_loss = train(train_dataset, model, tokenizer) logger.info(" global_step = %s, average loss = %s", global_step, tr_loss)
I still get this error when running this step despite having torch 1.3.0 and torchvision 0.4.1. Has anyone found a solution for this error?