readme: ---
  license: apache-2.0
  ---
  
  The pretrained model (pruned_transducer_stateless4) in https://github.com/k2-fsa/icefall/pull/380
  
  
  ### training
  
  ```
  #!/usr/bin/env bash
  
  set -x
  
  K2_ROOT=/path/to/k2
  ICEFALL=/path/to/icefall
  
  export PYTHONPATH=$K2_ROOT/k2/python:$PYTHONPATH
  export PYTHONPATH=$K2_ROOT/build/lib:$PYTHONPATH
  export PYTHONPATH=$ICEFALL:$PYTHONPATH
  
  export CUDA_VISIBLE_DEVICES="0,1,2,3"
  
  ./pruned_transducer_stateless4/train.py \
    --exp-dir pruned_transducer_stateless4/exp \
    --full-libri 1 \
    --dynamic-chunk-training 1 \
    --short-chunk-size 32 \
    --num-left-chunks 4 \
    --causal-convolution 1 \
    --max-duration 300 \
    --world-size 4 \
    --start-epoch 1 \
    --num-epochs 30
  ```
  
  ### decoding
  #### simulate streaming
  
  ```
  #!/usr/bin/env bash                                                                                                                                           
                                                                                                                                                                
  set -x                                                                                                                                                        
                                                                                                                                                                
  K2_ROOT=/path/to/k2
  ICEFALL=/path/to/icefall                                                                                                             
                                                                                                                                                                
  export PYTHONPATH=$K2_ROOT/k2/python:$PYTHONPATH                                                                                                              
  export PYTHONPATH=$K2_ROOT/build/lib:$PYTHONPATH                                                                                                              
  export PYTHONPATH=$ICEFALL:$PYTHONPATH                                                                                                                        
                                                                                                                                                                
  export CUDA_VISIBLE_DEVICES="0"                                                                                                                               
                                                                                                                                                                
  for size in 1 2 4 8 16 32; do                                                                                                                                
    for left in 32 64 -1; do                                                                                                                                    
      ./pruned_transducer_stateless4/decode.py \                                                                                                                
              --simulate-streaming 1 \                                                                                                                          
              --decode-chunk-size ${size} \
              --left-context ${left} \
              --causal-convolution 1 \
              --use-averaged-model 1 \
              --epoch 29 \
              --avg 6 \
              --exp-dir ./pruned_transducer_stateless4/exp \
              --max-sym-per-frame 1 \
              --max-duration 1000 \
              --decoding-method greedy_search
    done
  done
  ```
  
  #### streaming
  ```
  #!/usr/bin/env bash                                                                                                                                           
                                                                                                                                                                
  set -x                                                                                                                                                        
                                                                                                                                                                
  K2_ROOT=/path/to/k2
  ICEFALL=/path/to/icefall                                                                                                              
                                                                                                                                                                
  export PYTHONPATH=$K2_ROOT/k2/python:$PYTHONPATH                                                                                                              
  export PYTHONPATH=$K2_ROOT/build/lib:$PYTHONPATH                                                                                                              
  export PYTHONPATH=$ICEFALL:$PYTHONPATH     