Reading Bert model using ClassificationModel is failing with utf-8' codec can't decode byte 0x80 in position 0: invalid start byte
See original GitHub issueDescribe the bug A clear and concise description of what the bug is. Please specify the class causing the issue.
So I saved the classification model as a pickle file and I am trying to read it back it’s failing with the following error
‘utf-8’ codec can’t decode byte 0x80 in position 0: invalid start byte
this is because the it was read using r
mode in model_args.py line number 96 if read it using rb
this should fix the problem
To Reproduce Steps to reproduce the behavior: Save a classification model and try read it back
Expected behavior A clear and concise description of what you expected to happen.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS databrics cluster
Additional context Add any other context about the problem here.
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (4 by maintainers)
Top GitHub Comments
The saved model consists of all the files in the output directory. As the documentation says, it should be the path to the directory itself and not a particular file.
The example from the docs.
You don’t need to manually save the model. It gets saved during training according to the parameters you set (e.g.
save_steps
,save_model_every_epoch
).If your model files are in
/dbfs/FileStore/tables/
, then you would load them like so.This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.