Thank you for providing us with your trained model! I finally have the fine-tuned model working on my machine. But after struggling for a long time, here are some notes that may help future users who like me have little experience with these types of models.
In working through your example for using the fine-tuned FinBERT, I had issues installing torch==1.2.0 until I first ran pip install pytorch-pretrained-bert, which did the installation of torch for me and eliminated that issue.
I do not have a CUDA compatible GPU and so had to change device='cuda:1' to device='cpu'. I then needed to add map_location=device or map_location='cpu' when running model.load_state_dict(torch.load(fine_tuned_weight_path,map_location=device)).
These are rather simple changes, but they held me up for some time.
Thank you for providing us with your trained model! I finally have the fine-tuned model working on my machine. But after struggling for a long time, here are some notes that may help future users who like me have little experience with these types of models.
In working through your example for using the fine-tuned FinBERT, I had issues installing torch==1.2.0 until I first ran
pip install pytorch-pretrained-bert
, which did the installation of torch for me and eliminated that issue.I do not have a CUDA compatible GPU and so had to change
device='cuda:1'
todevice='cpu'
. I then needed to addmap_location=device
ormap_location='cpu'
when runningmodel.load_state_dict(torch.load(fine_tuned_weight_path,map_location=device))
.These are rather simple changes, but they held me up for some time.