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.48k stars 127 forks source link

Fine-tuning example: `trainer` package / `GlinerTrainer` class not available #109

Closed rmitsch closed 6 months ago

rmitsch commented 6 months ago

Thanks for the cool project! I'm trying to fine-tuning with GLiNER and following this notebook.

However, with gliner==0.2.2 this

from trainer import GlinerTrainer  # same for this: from gliner.trainer import GlinerTrainer

fails, as the module can't be found. What's the correct way to import this?

urchade commented 6 months ago

Hi @rmitsch, I think that you have tu put trainer.py (https://github.com/urchade/GLiNER/blob/main/examples/finetuning/trainer.py) in the same directory as the notebook (if that's not already the case)

rmitsch commented 6 months ago

Ah, I missed that this isn't part of the package. Thanks!