-
Notifications
You must be signed in to change notification settings - Fork 814
changing default root for datasets #1361
Changes from all commits
3766d9b
77a9424
7c04eb4
2620cfa
29f66d7
b906f19
ae68a7c
0bbf3c1
fe35ad4
93a63f1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -213,7 +213,7 @@ def _wrap_split_argument_with_fn(fn, splits): | |
| raise ValueError("Internal Error: Given function {} did not adhere to standard signature.".format(fn)) | ||
|
|
||
| @functools.wraps(fn) | ||
| def new_fn(root='.data', split=splits, **kwargs): | ||
| def new_fn(root=os.path.expanduser('~/.torchtext/cache'), split=splits, **kwargs): | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this BC-breaking change?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is a good question. This is the default path where datasets will be downloaded. In worst case, the data would be downloaded again for users relying on default behavior instead of providing their own root folder. Any think else that could potentially make it BC-breaking?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see. I think it's on a boarder-line but it is okay to it as backward compatible. |
||
| result = [] | ||
| for item in _check_default_set(split, splits, fn.__name__): | ||
| result.append(fn(root, item, **kwargs)) | ||
|
|
@@ -250,7 +250,7 @@ def decorator(func): | |
| raise ValueError("Internal Error: Given function {} did not adhere to standard signature.".format(fn)) | ||
|
|
||
| @functools.wraps(func) | ||
| def wrapper(root='.data', *args, **kwargs): | ||
| def wrapper(root=os.path.expanduser('~/.torchtext/cache'), *args, **kwargs): | ||
| new_root = os.path.join(root, dataset_name) | ||
| if not os.path.exists(new_root): | ||
| os.makedirs(new_root) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧐 Is this cosmetic or was it broken before?