You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Regarding training data format for gliner-bi-large-v2 #291
Same issue here since 2 weeks ago with urchade/gliner_multiv2.1 model (actually a copy from 2024), I am trying to figure out if trainer had any changes reviewing @urchade's commits
Having the same issue. Were you able to find anything?
After more than 30 fine‑tuning runs with different hyperparameters and different mixes of my custom data and Pile‑NER, results are consistently terrible. The model assigns a single random label to almost every token. I also reran finetune.ipynb from the repository examples, with the original code and dataset, and saw the same behavior. @urchade@Ingvarstep maybe this needs to be investigated.
so far overriding original Trainer.training_step is making an impact in my trainings, just commenting this that bcs i wont be able to answer in a while, you need to further investigate:
class CustomTrainer(Trainer):
def training_step(self, model, inputs, num_items_in_batch):
return super().training_step(model, inputs)
Looks like they resolved it here: #294. We will need to test it out
I have tried to fine tune the "urchade/gliner_small-v2.1" model using the finetune.ipynb notebook based on discussion in #294.
"urchade/gliner_small-v2.1" fine tune output:
But when trying to fine tune "knowledgator/gliner-bi-large-v2.0", I am getting the keyerror:
The error comes during loading model from huggingface. Errro:
model = GLiNER.from_pretrained("knowledgator/gliner-bi-large-v2.0")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/imran/GLiNER/venv/lib/python3.12/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/root/imran/GLiNER/venv/lib/python3.12/site-packages/huggingface_hub/hub_mixin.py", line 568, in from_pretrained
instance = cls._from_pretrained(
^^^^^^^^^^^^^^^^^^^^^
File "/root/imran/GLiNER/venv/lib/python3.12/site-packages/gliner/model.py", line 846, in _from_pretrained
config = GLiNERConfig(**config_)
^^^^^^^^^^^^^^^^^^^^^^^
File "/root/imran/GLiNER/venv/lib/python3.12/site-packages/gliner/config.py", line 44, in __init__
encoder_config = CONFIG_MAPPING[encoder_config["model_type"]](**encoder_config)
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/imran/GLiNER/venv/lib/python3.12/site-packages/transformers/models/auto/configuration_auto.py", line 725, in __getitem__
raise KeyError(key)
KeyError: 'modernbert'
This did the job for me, as modernbert was recently added to Transformers and it could be that the auto configuration is not finding the key modernbert automatically so it needs an update.
Activity
dlb-pub2 commentedon Sep 22, 2025
Same issue here since 2 weeks ago with urchade/gliner_multiv2.1 model (actually a copy from 2024), I am trying to figure out if trainer had any changes reviewing @urchade's commits
filipsam789 commentedon Sep 22, 2025
Having the same issue. Were you able to find anything?
After more than 30 fine‑tuning runs with different hyperparameters and different mixes of my custom data and Pile‑NER, results are consistently terrible. The model assigns a single random label to almost every token. I also reran finetune.ipynb from the repository examples, with the original code and dataset, and saw the same behavior.
@urchade @Ingvarstep maybe this needs to be investigated.
dlb-pub2 commentedon Sep 22, 2025
so far overriding original Trainer.training_step is making an impact in my trainings, just commenting this that bcs i wont be able to answer in a while, you need to further investigate:
class CustomTrainer(Trainer):
def training_step(self, model, inputs, num_items_in_batch):
return super().training_step(model, inputs)
jzamora-281992 commentedon Sep 23, 2025
Same issue here but with this model: urchade/gliner_small-v2.1. Looking forward to an answer.
filipsam789 commentedon Sep 23, 2025
Looks like they resolved it here: #294. We will need to test it out
I-Am-Alam commentedon Sep 25, 2025
@filipsam789 Sure will try it out
I-Am-Alam commentedon Sep 25, 2025
@filipsam789
I have tried to fine tune the "urchade/gliner_small-v2.1" model using the finetune.ipynb notebook based on discussion in #294.
"urchade/gliner_small-v2.1" fine tune output:
But when trying to fine tune "knowledgator/gliner-bi-large-v2.0", I am getting the keyerror:
The error comes during loading model from huggingface.
Errro:
Looking forward for engagement on this issue.
MohamedAmineDHIAB commentedon Oct 2, 2025
@I-Am-Alam to fix that just do:
This did the job for me, as modernbert was recently added to Transformers and it could be that the auto configuration is not finding the key
modernbertautomatically so it needs an update.