From 9b4e0969f29dccdfa78a55219f8107e549c96e45 Mon Sep 17 00:00:00 2001
From: lzr265946 <lzr265946@alibaba-inc.com>
Date: 星期四, 07 九月 2023 17:19:02 +0800
Subject: [PATCH] fix transformerLM inference recipe

---
 egs/aishell2/transformerLM/run.sh |    4 +++-
 funasr/bin/lm_inference_launch.py |    1 +
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/egs/aishell2/transformerLM/run.sh b/egs/aishell2/transformerLM/run.sh
index 4a647c9..b04c643 100755
--- a/egs/aishell2/transformerLM/run.sh
+++ b/egs/aishell2/transformerLM/run.sh
@@ -214,13 +214,15 @@
     echo "Stage 3: Calc perplexity: ${lm_test_text}"
     
     python ../../../funasr/bin/lm_inference_launch.py \
-        --output_dir "${lm_exp}/perplexity_test" \
+        --output_dir "${lm_exp}/perplexity_test/output.1" \
         --ngpu "${gpu_num}" \
         --batch_size 1 \
         --train_config "${lm_exp}"/config.yaml \
         --model_file "${lm_exp}/${inference_lm}" \
         --data_path_and_name_and_type "${lm_test_text},text,text" \
         --num_workers 1 \
+        --gpuid_list 0 \
+        --mode "transformer" \
         --split_with_space false 
 fi
 
diff --git a/funasr/bin/lm_inference_launch.py b/funasr/bin/lm_inference_launch.py
index 236a923..f12f50a 100644
--- a/funasr/bin/lm_inference_launch.py
+++ b/funasr/bin/lm_inference_launch.py
@@ -183,6 +183,7 @@
             dtype=dtype,
             batch_size=batch_size,
             key_file=key_file,
+            preprocess_fn=preprocessor,
             num_workers=num_workers,
         )
 

--
Gitblit v1.9.1