Skip to content

Commit

Permalink
update sparrowhawk export grammars to able to skip pynini (NVIDIA#3346)
Browse files Browse the repository at this point in the history
Signed-off-by: Yang Zhang <[email protected]>
  • Loading branch information
yzhang123 authored Dec 16, 2021
1 parent 0169c41 commit 5739486
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tools/text_processing_deployment/export_grammars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ GRAMMARS="itn_grammars" # tn_grammars
INPUT_CASE="cased" # lower_cased, only for tn_grammars
LANGUAGE="en" # language, 'en' supports both TN and ITN, {'de', 'ru', 'es', 'fr'} supports ITN only
MODE="export"
CACHE_DIR="None" # path to cache dir with .far files (to speed the export)
OVERWRITE_CACHE="True" # Set to False to re-use .far files
FORCE_REBUILD="False" # Set to True to re-build docker file

Expand All @@ -49,6 +48,8 @@ do
fi
done


CACHE_DIR=${LANGUAGE}
echo "GRAMMARS = $GRAMMARS"
echo "MODE = $MODE"
echo "LANGUAGE = $LANGUAGE"
Expand All @@ -57,8 +58,10 @@ echo "CACHE_DIR = $CACHE_DIR"
echo "OVERWRITE_CACHE = $OVERWRITE_CACHE"
echo "FORCE_REBUILD = $FORCE_REBUILD"


if [[ ${OVERWRITE_CACHE,,} == "true" ]]; then
OVERWRITE_CACHE="--overwrite_cache "
python3 pynini_export.py --output_dir=. --grammars=${GRAMMARS} --input_case=${INPUT_CASE} --language=${LANGUAGE} --cache_dir=${CACHE_DIR} ${OVERWRITE_CACHE}|| exit 1
else OVERWRITE_CACHE=""
fi

Expand All @@ -67,7 +70,6 @@ if [[ ${FORCE_REBUILD,,} == "true" ]]; then
else FORCE_REBUILD=""
fi

python3 pynini_export.py --output_dir=. --grammars=${GRAMMARS} --input_case=${INPUT_CASE} --language=${LANGUAGE} --cache_dir=${CACHE_DIR} ${OVERWRITE_CACHE}|| exit 1
find . -name "Makefile" -type f -delete
bash docker/build.sh $FORCE_REBUILD

Expand Down

0 comments on commit 5739486

Please sign in to comment.