Closed ZJaume closed 1 year ago
cc @Rocketknight1
Derp, that's a problem with the example, I'll push a fix! The problem is that Keras recognizes dict
objects but not our BatchEncoding
returned by the tokenizer
, even though BatchEncoding
is a subclass of dict
.
If you replace the last line with model.fit(dict(tokenized_data), labels)
it should work.
Should be fixed by #20732
@Rocketknight1 I'm getting " 'dict' object is not callable" typeError when I used this solution, any idea why?
@baburz Sorry for the delay! Can you paste the exact code you ran?
System Info
transformers
version: 4.25.1Who can help?
@gante @Rocketknight1
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
Steps to reproduce:
I also had to change
dataset['text']
todataset['example']
Expected behavior
Train succesfully.