GLiNER icon indicating copy to clipboard operation
GLiNER copied to clipboard

ONNX conversion error in latest gliner version 0.2.10

Open hari-ag00 opened this issue 1 year ago • 2 comments

/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

hari-ag00 avatar Aug 22 '24 07:08 hari-ag00

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

MuhammadAlGeddawy avatar Aug 28 '24 08:08 MuhammadAlGeddawy

The issue was related to how ONNX matches positional arguments. In the latest commit, I included fixes for these issues.

Ingvarstep avatar Jun 24 '25 11:06 Ingvarstep