urchade / GLiNER

Generalist and Lightweight Model for Named Entity Recognition (Extract any entity types from texts) @ NAACL 2024
https://arxiv.org/abs/2311.08526
Apache License 2.0
1.35k stars 118 forks source link

ONNX conversion error in latest gliner version 0.2.10 #178

Open hari-ag00 opened 2 months ago

hari-ag00 commented 2 months ago

/usr/local/lib/python3.10/dist-packages/gliner/modeling/base.py in extract_prompt_features_and_word_embeddings(config, token_embeds, input_ids, attention_mask, text_lengths, words_mask, **kwargs) 53 54 max_embed_dim = num_class_tokens.max() ---> 55 max_text_length = text_lengths.max() 56 aranged_class_idx = torch.arange(max_embed_dim, 57 dtype=attention_mask.dtype,

AttributeError: 'NoneType' object has no attribute 'max'

But working with the earlier versions of gliner

MuhammadAlGeddawy commented 1 month ago

I was facing the same problem, try to install gliner==0.2.5 onnx==1.16.2. It works now