Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/stanfordnlp/stanza.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Bauer <horatio@gmail.com>2022-09-12 23:21:40 +0300
committerJohn Bauer <horatio@gmail.com>2022-09-12 23:21:40 +0300
commit3ad35528cbbd2ee5b5f0f3441b68599aaf760496 (patch)
treec0cc439bdd46cb91e40ff149aa179cdf5211fc14
parent8dc42113931992245112caf510c99c5cade2599c (diff)
Don't double save_dir if the user gives save_dir as part of the model filename
-rw-r--r--stanza/models/constituency_parser.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/stanza/models/constituency_parser.py b/stanza/models/constituency_parser.py
index f6d71823..a9ab0117 100644
--- a/stanza/models/constituency_parser.py
+++ b/stanza/models/constituency_parser.py
@@ -455,7 +455,9 @@ def parse_args(args=None):
if args['checkpoint']:
args['checkpoint_save_name'] = utils.checkpoint_name(args['save_dir'], model_save_file, args['checkpoint_save_name'])
- model_save_file = os.path.join(args['save_dir'], model_save_file)
+ model_dir = os.path.split(model_save_file)[0]
+ if model_dir != args['save_dir']:
+ model_save_file = os.path.join(args['save_dir'], model_save_file)
args['save_name'] = model_save_file
return args