Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Make directory at start of dict.save() #3250

Merged
merged 1 commit into from
Nov 5, 2020
Merged

Make directory at start of dict.save() #3250

merged 1 commit into from
Nov 5, 2020

Conversation

spencerp
Copy link
Contributor

@spencerp spencerp commented Nov 4, 2020

Patch description
If self.bpe.copy_codecs_file is hit before the directory is created, a "path does not exist" exception will be thrown. This won't happen until validation, which can waste a lot of time.

Testing steps

parlai train_model -t convai2 --model transformer/generator --dict-file /path/to/existing/model.dict --model-file /path/to/new/model --embedding-size 32 --n-positions 32 --truncate 32 --validation-every-n-epochs 0.01 --dict-tokenizer bpe

Where /path/to/existing/model.dict exists, but /path/to/new/ doesn't exist yet.

@klshuster
Copy link
Contributor

good catch, lgtm thanks!

@spencerp spencerp merged commit 3a908bc into master Nov 5, 2020
@spencerp spencerp deleted the dict-save branch November 5, 2020 15:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants