daominhkhanh20 / SpellingCorrection

MIT License
3 stars 0 forks source link

TypeError: new(): invalid data type 'str' #2

Closed hoangftran closed 2 years ago

hoangftran commented 2 years ago

When I train the model by running python train.py I got error:

Please help!

daominhkhanh20 commented 2 years ago

I preprocess all text to int before training model because I want to reduce time for convert text to int

hoangftran commented 2 years ago

I have no idea. Can you show me how to fix this error?

daominhkhanh20 commented 2 years ago

As you can see, torch tensor requires int, not str, because before I trained the model, I calculate all word ids, error ids,... . You can read my code in dataloader