utterworks / fast-bert

Super easy library for BERT based NLP models
Apache License 2.0
1.86k stars 341 forks source link

predict from sample_notebook producing error #281

Open rpoli40 opened 3 years ago

rpoli40 commented 3 years ago

When running the code getting the following error: Traceback (most recent call last): File "fb_predict_multilabel.py", line 102, in multi_label=True, model_type='bert', do_lower_case=False) File "/home/bert/pvenv/lib64/python3.6/site-packages/fast_bert/prediction.py", line 40, in init self.model_path, use_fast=use_fast_tokenizer File "/home/bert/pvenv/lib64/python3.6/site-packages/transformers/tokenization_auto.py", line 206, in from_pretrained config = AutoConfig.from_pretrained(pretrained_model_name_or_path, kwargs) File "/home/bert/pvenv/lib64/python3.6/site-packages/transformers/configuration_auto.py", line 203, in from_pretrained configdict, = PretrainedConfig.get_config_dict(pretrained_model_name_or_path, kwargs) File "/home/bert/pvenv/lib64/python3.6/site-packages/transformers/configuration_utils.py", line 225, in get_config_dict elif os.path.isfile(pretrained_model_name_or_path) or is_remote_url(pretrained_model_name_or_path): File "/home/bert/pvenv/lib64/python3.6/site-packages/transformers/file_utils.py", line 447, in is_remote_url parsed = urlparse(url_or_filename) File "/usr/lib64/python3.6/urllib/parse.py", line 367, in urlparse url, scheme, _coerce_result = _coerce_args(url, scheme) File "/usr/lib64/python3.6/urllib/parse.py", line 123, in _coerce_args return _decode_args(args) + (_encode_result,) File "/usr/lib64/python3.6/urllib/parse.py", line 107, in _decode_args return tuple(x.decode(encoding, errors) if x else '' for x in args) File "/usr/lib64/python3.6/urllib/parse.py", line 107, in return tuple(x.decode(encoding, errors) if x else '' for x in args) AttributeError: 'PosixPath' object has no attribute 'decode'