From e1cfaf28ef4d4955833f5b5114fa3bf091a8bc1b Mon Sep 17 00:00:00 2001 From: yifanyeung Date: Wed, 30 Oct 2024 03:19:03 -0700 Subject: [PATCH] fix str2bool --- egs/libriheavy/ASR/local/prepare_manifest.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/egs/libriheavy/ASR/local/prepare_manifest.py b/egs/libriheavy/ASR/local/prepare_manifest.py index d7e184d863..a57a3749d2 100755 --- a/egs/libriheavy/ASR/local/prepare_manifest.py +++ b/egs/libriheavy/ASR/local/prepare_manifest.py @@ -20,6 +20,8 @@ import sys from pathlib import Path +from icefall.utils import str2bool + def simple_cleanup(text: str) -> str: table = str.maketrans("’‘,。;?!():-《》、“”【】", "'',.;?!(): <>/\"\"[]") @@ -34,7 +36,7 @@ def main(): ), "Usage: ./local/prepare_manifest.py INPUT OUTPUT_DIR KEEP_CUSTOM_FIELDS" fname = Path(sys.argv[1]).name oname = Path(sys.argv[2]) / fname - keep_custom_fields = bool(sys.argv[3]) + keep_custom_fields = str2bool(sys.argv[3]) with gzip.open(sys.argv[1], "r") as fin, gzip.open(oname, "w") as fout: for line in fin: cut = json.loads(line)