Skip to content

Commit

Permalink
checking params and checkpoint separately
Browse files Browse the repository at this point in the history
  • Loading branch information
Nempickaxe authored Feb 19, 2021
1 parent 46d17fc commit 7bfe61a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions fastpunct/fastpunct.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,13 @@ def __init__(self, lang_code="en", weights_path=None, params_path=None):

home = os.path.expanduser("~")
lang_path = os.path.join(home, '.fastPunct_' + lang_code)
if (weights_path is None) or (params_path is None):
if weights_path is None:
weights_path = os.path.join(lang_path, 'checkpoint.h5')
if params_path is None:
params_path = os.path.join(lang_path, 'params.pkl')


#if either of the paths are not mentioned, then, make lang directory from home
if (params_path is None) or (weights_path is None):
if not os.path.exists(lang_path):
os.mkdir(lang_path)

Expand Down

0 comments on commit 7bfe61a

Please sign in to comment.