From 308a7bb00e0e9e8525848cf8c894245d0f9eaa70 Mon Sep 17 00:00:00 2001 From: yzhangcs Date: Mon, 29 May 2023 00:12:53 +0800 Subject: [PATCH] Specify path to bin files --- supar/parser.py | 2 +- supar/utils/data.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/supar/parser.py b/supar/parser.py index 8d8681cb..26a2811d 100644 --- a/supar/parser.py +++ b/supar/parser.py @@ -320,7 +320,7 @@ def evaluate( self.transform.train() logger.info("Loading the data") if args.cache: - args.bin = os.path.join(os.path.dirname(args.path), 'bin') + args.bin = args.get('bin', os.path.join(os.path.dirname(args.path), 'bin')) if is_dist(): batch_size = batch_size // dist.get_world_size() data = Dataset(self.transform, **args) diff --git a/supar/utils/data.py b/supar/utils/data.py index 74632d3a..3ec66a6d 100644 --- a/supar/utils/data.py +++ b/supar/utils/data.py @@ -44,7 +44,7 @@ class Dataset(torch.utils.data.Dataset): binarize (bool): If ``True``, binarizes the dataset once building it. Only works if ``cache=True``. Default: ``False``. bin (str): - Path for saving binarized files, required if ``cache=True``. Default: ``None``. + Path to binarized files, required if ``cache=True``. Default: ``None``. max_len (int): Sentences exceeding the length will be discarded. Default: ``None``. kwargs (Dict):