repo id error
when runningtokenizer = LongBERTTokenizer.from_pretrained(backbone),
wherebackbone = 'minhtriphan/LongFinBERT-base'
following errors occuredhuggingface_hub.errors.HFValidationError: Repo id must use alphanumeric chars or '-', '_', '.', '--' and '..' are forbidden, '-' and '.' cannot start or end the name, max length is 96: ''.
The above exception was the direct cause of the following exception:
File "D:\ProgramData\miniconda3\envs\nlp\Lib\site-packages\transformers\utils\hub.py", line 469, in cached_file raise EnvironmentError( OSError: Incorrect path_or_model_id: ''. Please provide either the path to a local folder or the repo_id of a model on the Hub.
after review,
after_special_tokens_map = hf_hub_download(repo_id = ckpt, filename = 'special_tokens_map.json')
_special_tokens_map would become 'C:\\Users\\dowba\\.cache\\huggingface\\hub\\models--minhtriphan--LongFinBERT-base\\snapshots\\c4b66fa6f1e519c8fe93d28dadc550bf2da42dad\\special_tokens_map.json'
in my case.
in path = '/'.join(_special_tokens_map.split('/')[:-1])
, path would become ''
.
I recommend to use pathlib to work well in both Linux and Windows Environments, withpath = str(pathlib.Path(_special_tokens_map).parent)
Thanks! I have updated the repo. Let me know if it still doesn't work