我正在编写一个代码,使用本教程中的XLnet预训练模型对有毒评论进行分类: https://towardsdatascience.com/multi-label-text-classification-with-xlnet-b5f5755302df 但是在这里训练期间:
num_epochs=3
cwd = os.getcwd()
model_save_path = output_model_file = os.path.join(cwd, "drive/My Drive/Models/xlnet_toxic.bin")
model, train_loss_set, valid_loss_set = train(model=model,\num_epochs=num_epochs,\
optimizer=optimizer,\train_dataloader=train_dataloader,\valid_dataloader=validation_dataloader,\model_save_path=model_save_path,\device="cuda")