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

AttributeError: 'BertModel' object has no attribute 'model_max_length' #2

Open
plum-Yin opened this issue Apr 22, 2023 · 0 comments
Open

Comments

@plum-Yin
Copy link

plum-Yin commented Apr 22, 2023

Hi, when I run

model_name = r'batterydata/batterybert-cased'
tokenizer = BertTokenizer.from_pretrained(model_name)
model = BertModel.from_pretrained(model_name, output_attentions=True)

from batterycode.apps import DeviceDataExtractor

extractor = DeviceDataExtractor(model)
sample_text = "The anode of this Li-ion battery is graphite."
result = extractor.extract(sample_text, threshold=0.1)

the result is

AttributeError: 'BertModel' object has no attribute 'model_max_length'

I tried different versions of transformers, but it shows the same results.
Could you tell me what version you use?
Thanks.

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