Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Commit

Permalink
Fix Checkpointer cleaner regex on Windows (#5361)
Browse files Browse the repository at this point in the history
* Fix to work on Windows

* Update CHANGELOG.md

* Update CHANGELOG.md

Co-authored-by: Pete <petew@allenai.org>
Co-authored-by: Pete <epwalsh10@gmail.com>
  • Loading branch information
3 people authored Aug 27, 2021
1 parent 27da04c commit 6355f07
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `TransformerTextField` can now take tensors of shape `(1, n)` like the tensors produced from a HuggingFace tokenizer.
- `tqdm` lock is now set inside `MultiProcessDataLoading` when new workers are spawned to avoid contention when writing output.
- `ConfigurationError` is now pickleable.
- Checkpointer cleaning was fixed to work on Windows Paths
- Multitask models now support `TextFieldTensor` in heads, not just in the backbone.
- Fixed the signature of `ScaledDotProductAttention` to match the other `Attention` classes
- Fixed the way names are applied to Tango `Step` instances.
Expand Down
4 changes: 2 additions & 2 deletions allennlp/training/checkpointer.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ def _training_state_path(self, epochs_completed: int, batches_in_epoch_completed
else:
return path + ".th"

_model_state_file_re = re.compile(r"(.*/)?model_state_e(\d+)_b(\d+)(_w\d+)?\.th$")
_training_state_file_re = re.compile(r"(.*/)?training_state_e(\d+)_b(\d+)(_w\d+)?\.th$")
_model_state_file_re = re.compile(r"(.*[/\\])?model_state_e(\d+)_b(\d+)(_w\d+)?\.th$")
_training_state_file_re = re.compile(r"(.*[/\\])?training_state_e(\d+)_b(\d+)(_w\d+)?\.th$")

@classmethod
def _parse_model_state_path(cls, path: Union[str, os.PathLike]) -> Optional[Tuple[int, int]]:
Expand Down

0 comments on commit 6355f07

Please sign in to comment.