Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 73 additions & 61 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
pipeline {
agent {
docker {
image 'tnitn_ci_py310:24.07'
args '-v /mnt/jenkins/jenkinsci/TestData:/home/jenkins/TestData -v $HOME/.cache:/root/.cache --shm-size=4g --entrypoint=""'
}
docker {
image 'tnitn_ci_py310:24.07'
args '-v /mnt/jenkins/jenkinsci/TestData:/home/jenkins/TestData -v $HOME/.cache:/root/.cache --shm-size=4g --entrypoint=""'
}
}
options {
timeout(time: 2, unit: 'HOURS')
Expand All @@ -28,11 +28,11 @@ pipeline {
MR_TN_CACHE='/home/jenkins/TestData/text_norm/ci/grammars/03-12-24-1'
JA_TN_CACHE='/home/jenkins/TestData/text_norm/ci/grammars/10-17-24-1'
HI_TN_CACHE='/home/jenkins/TestData/text_norm/ci/grammars/02-18-26-0'
KO_TN_CACHE='/home/jenkins/TestData/text_norm/ci/grammars/06-03-25-0'
DEFAULT_TN_CACHE='/home/jenkins/TestData/text_norm/ci/grammars/06-08-23-0'
}
stages {


stage('PyTorch version') {
steps {
sh 'python -c "import torch; print(torch.__version__)"'
Expand All @@ -46,15 +46,13 @@ pipeline {
}
}


stage('L0: Create EN TN/ITN Grammars') {
when {
anyOf {
branch 'main'
branch 'staging/**'
branch 'staging_*'
changeRequest target: 'main'

}
}
failFast true
Expand All @@ -79,31 +77,30 @@ pipeline {
sh 'CUDA_VISIBLE_DEVICES="" python nemo_text_processing/inverse_text_normalization/inverse_normalize.py --language en --text="twenty" --cache_dir ${EN_TN_CACHE}'
}
}

}
}

stage('L0: Create HI TN/ITN Grammars') {
when {
when {
anyOf {
branch 'main'
branch 'staging/**'
branch 'staging_*'
changeRequest target: 'main'
branch 'main'
branch 'staging/**'
branch 'staging_*'
changeRequest target: 'main'
}
}
failFast true
parallel {
}
failFast true
parallel {
stage('L0: Hi TN grammars') {
steps {
sh 'CUDA_VISIBLE_DEVICES="" python nemo_text_processing/text_normalization/normalize.py --lang=hi --text="१" --cache_dir ${HI_TN_CACHE}'
}
steps {
sh 'CUDA_VISIBLE_DEVICES="" python nemo_text_processing/text_normalization/normalize.py --lang=hi --text="१" --cache_dir ${HI_TN_CACHE}'
}
}
stage('L0: Hi ITN grammars') {
steps {
sh 'CUDA_VISIBLE_DEVICES="" python nemo_text_processing/inverse_text_normalization/inverse_normalize.py --lang=hi --text="एक" --cache_dir ${HI_TN_CACHE}'
}
steps {
sh 'CUDA_VISIBLE_DEVICES="" python nemo_text_processing/inverse_text_normalization/inverse_normalize.py --lang=hi --text="एक" --cache_dir ${HI_TN_CACHE}'
}
}

}
}

Expand Down Expand Up @@ -149,7 +146,7 @@ pipeline {
stage('L0: Create AR TN/ITN Grammars') {
when {
anyOf {
branch 'main'
branch 'main'
branch 'staging/**'
branch 'staging_*'
changeRequest target: 'main'
Expand All @@ -167,14 +164,13 @@ pipeline {
sh 'CUDA_VISIBLE_DEVICES="" python nemo_text_processing/inverse_text_normalization/inverse_normalize.py --lang=ar --text="اثنان " --cache_dir ${AR_TN_CACHE}'
}
}

}
}

stage('L0: Create FR TN/ITN & VI TN/ITN & HU TN & IT TN') {
when {
anyOf {
branch 'main'
branch 'main'
branch 'staging/**'
branch 'staging_*'
changeRequest target: 'main'
Expand Down Expand Up @@ -203,7 +199,7 @@ pipeline {
}
}
stage('L0: HU TN grammars') {
steps {
steps {
sh 'CUDA_VISIBLE_DEVICES="" python nemo_text_processing/text_normalization/normalize.py --lang=hu --text="100" --cache_dir ${HU_TN_CACHE}'
}
}
Expand All @@ -218,7 +214,7 @@ pipeline {
stage('L0: Create RU TN/ITN Grammars & SV & PT') {
when {
anyOf {
branch 'main'
branch 'main'
branch 'staging/**'
branch 'staging_*'
changeRequest target: 'main'
Expand All @@ -237,31 +233,32 @@ pipeline {
}
}
stage('L0: SV TN grammars') {
steps {
steps {
sh 'CUDA_VISIBLE_DEVICES="" python nemo_text_processing/text_normalization/normalize.py --lang=sv --text="100" --cache_dir ${SV_TN_CACHE}'
}
}
// stage('L0: SV ITN grammars') {
// steps {
// sh 'CUDA_VISIBLE_DEVICES="" python nemo_text_processing/inverse_text_normalization/inverse_normalize.py --lang=sv --text="hundra " --cache_dir ${SV_TN_CACHE}'
// }
// }
// stage('L0: PT TN grammars') {
// steps {
// sh 'CUDA_VISIBLE_DEVICES="" python nemo_text_processing/text_normalization/normalize.py --lang=pt --text="2" --cache_dir ${DEFAULT_TN_CACHE}'
// }
// }
// stage('L0: SV ITN grammars') {
// steps {
// sh 'CUDA_VISIBLE_DEVICES="" python nemo_text_processing/inverse_text_normalization/inverse_normalize.py --lang=sv --text="hundra " --cache_dir ${SV_TN_CACHE}'
// }
// }
// stage('L0: PT TN grammars') {
// steps {
// sh 'CUDA_VISIBLE_DEVICES="" python nemo_text_processing/text_normalization/normalize.py --lang=pt --text="2" --cache_dir ${DEFAULT_TN_CACHE}'
// }
// }
stage('L0: PT ITN grammars') {
steps {
sh 'CUDA_VISIBLE_DEVICES="" python nemo_text_processing/inverse_text_normalization/inverse_normalize.py --lang=pt --text="dez " --cache_dir ${PT_TN_CACHE}'
}
}
}
}
stage('L0: Create He TN/ITN Grammars & MR') {

stage('L0: Create He TN/ITN Grammars & MR') {
when {
anyOf {
branch 'main'
branch 'main'
branch 'staging/**'
branch 'staging_*'
changeRequest target: 'main'
Expand All @@ -276,10 +273,11 @@ pipeline {
}
}
}

stage('L0: Create HY TN/ITN Grammars & MR') {
when {
anyOf {
branch 'main'
branch 'main'
branch 'staging/**'
branch 'staging_*'
changeRequest target: 'main'
Expand All @@ -304,10 +302,11 @@ pipeline {
}
}
}

stage('L0: Create ZH TN/ITN Grammar') {
when {
anyOf {
branch 'main'
branch 'main'
branch 'staging/**'
branch 'staging_*'
changeRequest target: 'main'
Expand All @@ -327,10 +326,11 @@ pipeline {
}
}
}

stage('L0: Create JA ITN Grammars') {
when {
anyOf {
branch 'main'
branch 'main'
branch 'staging/**'
branch 'staging_*'
changeRequest target: 'main'
Expand All @@ -346,13 +346,29 @@ pipeline {
}
}

stage('L0: Create KO TN Grammars') {
when {
anyOf {
branch 'main'
changeRequest target: 'main'
}
}
failFast true
parallel {
stage('L0: KO TN grammars') {
steps {
sh 'CUDA_VISIBLE_DEVICES="" python nemo_text_processing/text_normalization/normalize.py --lang=ko --text="100" --cache_dir ${KO_TN_CACHE}'
}
}
}
}

// L1 Tests starts here
// L1 Tests starts here

stage('L1: TN/ITN Tests CPU') {
when {
anyOf {
branch 'main'
branch 'main'
branch 'staging/**'
branch 'staging_*'
changeRequest target: 'main'
Expand Down Expand Up @@ -424,7 +440,7 @@ pipeline {
steps {
sh 'CUDA_VISIBLE_DEVICES="" pytest tests/nemo_text_processing/ja/ -m "not pleasefixme" --cpu --tn_cache_dir ${JA_TN_CACHE}'
}
}
}
stage('L1: Run all MR ITN tests (restore grammars from cache)') {
steps {
sh 'CUDA_VISIBLE_DEVICES="" pytest tests/nemo_text_processing/mr/ -m "not pleasefixme" --cpu --tn_cache_dir ${MR_TN_CACHE}'
Expand All @@ -440,13 +456,18 @@ pipeline {
sh 'CUDA_VISIBLE_DEVICES="" pytest tests/nemo_text_processing/he/ -m "not pleasefixme" --cpu --tn_cache_dir ${HE_TN_CACHE}'
}
}
stage('L1: Run all KO TN/ITN tests (restore grammars from cache)') {
steps {
sh 'CUDA_VISIBLE_DEVICES="" pytest tests/nemo_text_processing/ko/ -m "not pleasefixme" --cpu --tn_cache_dir ${KO_TN_CACHE}'
}
}
}
}

stage('L2: EN Sparrowhawk Tests') {
stage('L2: EN Sparrowhawk Tests') {
when {
anyOf {
branch 'main'
branch 'main'
branch 'staging/**'
branch 'staging_*'
changeRequest target: 'main'
Expand All @@ -458,14 +479,12 @@ pipeline {
steps {
sh 'CUDA_VISIBLE_DEVICES="" cp -r /workspace/sparrowhawk/documentation/grammars /workspace/sparrowhawk/documentation/grammars_en_itn_grammars_lower_cased && cd tools/text_processing_deployment && bash sh_test.sh --MODE="test_itn_grammars" --OVERWRITE_CACHE=False --FAR_PATH=${EN_TN_CACHE}/SH_ITN --LANGUAGE="en"'
sh 'CUDA_VISIBLE_DEVICES="" cd tests/nemo_text_processing/en && bash test_sparrowhawk_inverse_text_normalization.sh /workspace/sparrowhawk/documentation/grammars_en_itn_grammars_lower_cased `pwd`'

}
}
stage('L2: EN ITN Run Sparrowhawk test - Cased Input') {
steps {
sh 'CUDA_VISIBLE_DEVICES="" cp -r /workspace/sparrowhawk/documentation/grammars /workspace/sparrowhawk/documentation/grammars_en_itn_grammars_cased && cd tools/text_processing_deployment && bash sh_test.sh --MODE="test_itn_grammars" --INPUT_CASE="cased" --OVERWRITE_CACHE=False --FAR_PATH=${EN_TN_CACHE}/SH_ITN_cased --LANGUAGE="en"'
sh 'CUDA_VISIBLE_DEVICES="" cd tests/nemo_text_processing/en && bash test_sparrowhawk_inverse_text_normalization_cased.sh /workspace/sparrowhawk/documentation/grammars_en_itn_grammars_cased `pwd`'

}
}
stage('L2: EN TN Run Sparrowhawk test') {
Expand All @@ -474,14 +493,13 @@ pipeline {
sh 'CUDA_VISIBLE_DEVICES="" cd tests/nemo_text_processing/en && bash test_sparrowhawk_normalization.sh /workspace/sparrowhawk/documentation/grammars_en_tn_grammars_cased `pwd`'
}
}

}
}

stage('L2: NeMo text processing') {
when {
anyOf {
branch 'main'
branch 'main'
branch 'staging/**'
branch 'staging_*'
changeRequest target: 'main'
Expand All @@ -500,7 +518,6 @@ pipeline {
rm -rf $NORM_OUTPUT_DIR'
}
}

stage('L2: Eng ITN export') {
steps {
sh 'TIME=`date +"%Y-%m-%d-%T"` && DENORM_OUTPUT_DIR=/home/jenkins/TestData/text_denorm/output_${TIME} && \
Expand All @@ -511,8 +528,6 @@ pipeline {
rm -rf $DENORM_OUTPUT_DIR'
}
}


stage('L2: Eng alignment TN') {
steps {
sh 'TIME=`date +"%Y-%m-%d-%T"` && NORM_OUTPUT_DIR=/home/jenkins/TestData/text_norm/output_${TIME} && mkdir $NORM_OUTPUT_DIR && \
Expand All @@ -521,7 +536,6 @@ pipeline {
rm -rf $NORM_OUTPUT_DIR'
}
}

stage('L2: Eng alignment ITN') {
steps {
sh 'TIME=`date +"%Y-%m-%d-%T"` && DENORM_OUTPUT_DIR=/home/jenkins/TestData/text_denorm/output_${TIME} && mkdir $DENORM_OUTPUT_DIR && \
Expand All @@ -530,16 +544,14 @@ pipeline {
rm -rf $DENORM_OUTPUT_DIR'
}
}

}
}
}


post {
always {
sh 'chmod -R 777 .'
cleanWs()
}
}
}
}
17 changes: 17 additions & 0 deletions nemo_text_processing/text_normalization/ko/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from nemo_text_processing.text_normalization.en.taggers.tokenize_and_classify import ClassifyFst
from nemo_text_processing.text_normalization.en.verbalizers.verbalize import VerbalizeFst
from nemo_text_processing.text_normalization.en.verbalizers.verbalize_final import VerbalizeFinalFst
13 changes: 13 additions & 0 deletions nemo_text_processing/text_normalization/ko/data/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
Loading
Loading