Skip to content

Commit

Permalink
Merge pull request #3926 from astewartau/patch-1
Browse files Browse the repository at this point in the history
Update learner.py - fixed type in warning
  • Loading branch information
jph00 committed Jul 24, 2023
2 parents b4d8ac0 + 16bfd98 commit f21ab58
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion fastai/learner.py
Expand Up @@ -56,7 +56,7 @@ def load_model(file, model, opt, with_opt=True, device=None, strict=True, **torc
try: opt.load_state_dict(state['opt'])
except:
if with_opt: warn("Could not load the optimizer state.")
elif with_opt: warn("Saved filed doesn't contain an optimizer state.")
elif with_opt: warn("Saved file doesn't contain an optimizer state.")

# %% ../nbs/13a_learner.ipynb 19
def _try_concat(o):
Expand Down
2 changes: 1 addition & 1 deletion fastai/text/learner.py
Expand Up @@ -95,7 +95,7 @@ def load_model_text(
try: opt.load_state_dict(state['opt'])
except:
if with_opt: warn("Could not load the optimizer state.")
elif with_opt: warn("Saved filed doesn't contain an optimizer state.")
elif with_opt: warn("Saved file doesn't contain an optimizer state.")

# %% ../../nbs/37_text.learner.ipynb 17
@delegates(Learner.__init__)
Expand Down
2 changes: 1 addition & 1 deletion nbs/13a_learner.ipynb
Expand Up @@ -223,7 +223,7 @@
" try: opt.load_state_dict(state['opt'])\n",
" except:\n",
" if with_opt: warn(\"Could not load the optimizer state.\")\n",
" elif with_opt: warn(\"Saved filed doesn't contain an optimizer state.\")"
" elif with_opt: warn(\"Saved file doesn't contain an optimizer state.\")"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion nbs/37_text.learner.ipynb
Expand Up @@ -243,7 +243,7 @@
" try: opt.load_state_dict(state['opt'])\n",
" except:\n",
" if with_opt: warn(\"Could not load the optimizer state.\")\n",
" elif with_opt: warn(\"Saved filed doesn't contain an optimizer state.\")"
" elif with_opt: warn(\"Saved file doesn't contain an optimizer state.\")"
]
},
{
Expand Down

0 comments on commit f21ab58

Please sign in to comment.