Closed gptob closed 2 weeks ago
This is caused by a recent change in transformers: https://github.com/huggingface/transformers/commit/6ba31a8a94bf7cfeaf59ffc3bc9e0b0cd3e25788#diff-ed55888e6665791fe92cc8fc0c499da54f4ace6738551cd9a2591881cda076deR2458
You should downgrade transformers to 4.45.2 (the most recent version supported by GLiNER)
I am trying finetuning with the example code and data, but it returns this error on training:
File "Gliner_FineTuning.py", line 84, in
trainer.train()
File "lib/python3.12/site-packages/transformers/trainer.py", line 2122, in train
return inner_training_loop(
^^^^^^^^^^^^^^^^^^^^
File "lib/python3.12/site-packages/transformers/trainer.py", line 2474, in _inner_training_loop
tr_loss_step = self.training_step(model, inputs, num_items_in_batch)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Trainer.training_step() takes 3 positional arguments but 4 were given