Open ctxya1207 opened 8 months ago
Hi @ctxya1207 ,
I tried it with the latest master
version of Flair and it is working. Maybe you can try to upgrade your local Flair version with:
pip3 install --upgrade flair
To get it working :)
I updated flair to the latest stable version and is still not working:
flair
version: 0.13.1torch
version: 2.2.0transformers
version: 4.41.1Code:
from flair.models import SequenceTagger
model = SequenceTagger.load("chunk")
Error:
AttributeError: 'dict' object has no attribute 'embedding_length'
Any help with this? Is there any chunk model working with the latest flair/transformers/torch versions? If not, is it going to be fixed?
Hi @ctxya1207 ,
I tried it with the latest
master
version of Flair and it is working. Maybe you can try to upgrade your local Flair version with:pip3 install --upgrade flair
To get it working :)
I am getting this error now:
File "/home/prajna/openie-with-entities/scripts/violations_json.py", line 58, in <module>
tagger.predict(sentences_list, mini_batch_size=256)
File "/home/prajna/miniconda3/envs/openie_entities/lib/python3.9/site-packages/flair/models/sequence_tagger_model.py", line 465, in predict
Sentence.set_context_for_sentences(cast(List[Sentence], sentences))
File "/home/prajna/miniconda3/envs/openie_entities/lib/python3.9/site-packages/flair/data.py", line 1186, in set_context_for_sentences
if sentence.is_context_set():
AttributeError: 'str' object has no attribute 'is_context_set'
Question
Traceback (most recent call last): File "E:\Project\pythonProject\ResNet18\1.py", line 5, in
tagger = SequenceTagger.load("E:\Project\pythonProject\LFR-GAN_TOMM2023-master\pretrained_models\chunk-english\pytorch_model.bin")
File "E:\Anaconda\envs\lfr_gan\lib\site-packages\flair\nn\model.py", line 144, in load
model = cls._init_model_with_state_dict(state)
File "E:\Anaconda\envs\lfr_gan\lib\site-packages\flair\models\sequence_tagger_model.py", line 640, in _init_model_with_state_dict
kwargs,
File "E:\Anaconda\envs\lfr_gan\lib\site-packages\flair\nn\model.py", line 74, in _init_model_with_state_dict
model = cls(kwargs)
File "E:\Anaconda\envs\lfr_gan\lib\site-packages\flair\models\sequence_tagger_model.py", line 112, in init
embedding_dim: int = embeddings.embedding_length
AttributeError: 'dict' object has no attribute 'embedding_length'