I'm using hugginface model distilbert-base-uncased
and tokenizer DistilBertTokenizerFast
and I'm loading them currently using .from_pretrained()
I want cache them so that they work without internet was well.
I tried cache_dir
parameter in the from_pretrained()
but it didn't work.
Any suggestions?
I solved the problem by these steps:
.from_pretrained()
with cache_dir = RELATIVE_PATH
to download the filesconfig.json
. Copy this nameconfig.json
).from_pretrained(RELATIVE_PATH, local_files_only = True)
in your model/tokenizer.This solution should work