text
text copied to clipboard
Need makedirs call for .vector_cache when path to custom embeddings is passed to Vectors init
https://github.com/pytorch/text/blob/4ecb8d8b04b2f9ac3295e96f53409b98cd706c0a/torchtext/vocab.py#L256
The makedirs call here needs to be moved to just before the cache is written to. Otherwise, if you specify a custom pre-trained embeddings file, it will error with
No such file or directory: u'.vector_cache/wiki_en.emb.pt'.
@zhzhang I might be missing something, but I haven't been able to reproduce the exception. Could you please provide your code snippet and exactly what folders and files exist at the time? Thanks.