Skip to content
New issue

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

Problem with BERT #5

Open
davidaino opened this issue Jul 24, 2023 · 0 comments
Open

Problem with BERT #5

davidaino opened this issue Jul 24, 2023 · 0 comments

Comments

@davidaino
Copy link

davidaino commented Jul 24, 2023

Hi, in the execution of your 7_FOMC_Analysis_By_Sentence.ipynb I had a problem with the following snippet of code

from transformers import BertTokenizer, BertForSequenceClassification, BertModel
model = BertForSequenceClassification.from_pretrained('bert-base-uncased', num_labels=3)
model.load_state_dict(torch.load(model_dir + 'finphrase_bert_trained.dict', map_location=torch.device('cpu')))
model.eval()
model.to("cpu")

I solved the problem downgrading transformes from 3.5.0 to 2.8.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant