From 457c16ab544921456806c633b5519f29e2ef4392 Mon Sep 17 00:00:00 2001 From: Prakash Ranganathan Date: Mon, 11 May 2020 18:15:38 +0530 Subject: [PATCH] modified tfrecords_path split by / to accomodate windows path as well, as path separators are different for windows and linux --- finetune/preprocessing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/finetune/preprocessing.py b/finetune/preprocessing.py index 991f08b..bbefc2c 100644 --- a/finetune/preprocessing.py +++ b/finetune/preprocessing.py @@ -78,7 +78,7 @@ def _serialize_dataset(self, tasks, is_training, split): examples += task_examples if is_training: random.shuffle(examples) - utils.mkdir(tfrecords_path.rsplit("/", 1)[0]) + utils.mkdir(os.path.dirname(tfrecords_path)) n_examples = self.serialize_examples( examples, is_training, tfrecords_path, batch_size) utils.write_json({"n_examples": n_examples}, metadata_path)