Files changed (1) hide show
  1. README.md +116 -0
README.md CHANGED
@@ -1,3 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: apache-2.0
3
  ---
 
1
+ ### training
2
+ ```
3
+ #!/usr/bin/env bash
4
+
5
+ set -x
6
+
7
+ K2_ROOT=/path/to/k2
8
+ ICEFALL=/path/to/icefall
9
+
10
+ export PYTHONPATH=$K2_ROOT/k2/python:$PYTHONPATH
11
+ export PYTHONPATH=$K2_ROOT/build/lib:$PYTHONPATH
12
+ export PYTHONPATH=$ICEFALL:$PYTHONPATH
13
+
14
+ export CUDA_VISIBLE_DEVICES="0,1,2,3"
15
+
16
+ ./pruned_transducer_stateless4/train.py \
17
+ --exp-dir pruned_transducer_stateless4/exp \
18
+ --full-libri 1 \
19
+ --dynamic-chunk-training 1 \
20
+ --short-chunk-size 32 \
21
+ --num-left-chunks 4 \
22
+ --causal-convolution 1 \
23
+ --max-duration 300 \
24
+ --world-size 4 \
25
+ --start-epoch 1 \
26
+ --num-epochs 30
27
+ ```
28
+
29
+ ### decoding
30
+ #### simulate streaming
31
+ ```
32
+ #!/usr/bin/env bash
33
+
34
+ set -x
35
+
36
+ K2_ROOT=/path/to/k2
37
+ ICEFALL=/path/to/icefall
38
+
39
+ export PYTHONPATH=$K2_ROOT/k2/python:$PYTHONPATH
40
+ export PYTHONPATH=$K2_ROOT/build/lib:$PYTHONPATH
41
+ export PYTHONPATH=$ICEFALL:$PYTHONPATH
42
+
43
+ export CUDA_VISIBLE_DEVICES="0"
44
+
45
+ for size in 1 2 4 8 16 32; do
46
+ for left in 32 64 -1; do
47
+ ./pruned_transducer_stateless4/decode.py \
48
+ --simulate-streaming 1 \
49
+ --decode-chunk-size ${size} \
50
+ --left-context ${left} \
51
+ --causal-convolution 1 \
52
+ --use-averaged-model 1 \
53
+ --epoch 29 \
54
+ --avg 6 \
55
+ --exp-dir ./pruned_transducer_stateless4/exp \
56
+ --max-sym-per-frame 1 \
57
+ --max-duration 1000 \
58
+ --decoding-method greedy_search
59
+ done
60
+ done
61
+ ```
62
+
63
+ #### streaming
64
+ ```
65
+ #!/usr/bin/env bash
66
+
67
+ set -x
68
+
69
+ K2_ROOT=/path/to/k2
70
+ ICEFALL=/path/to/icefall
71
+
72
+ export PYTHONPATH=$K2_ROOT/k2/python:$PYTHONPATH
73
+ export PYTHONPATH=$K2_ROOT/build/lib:$PYTHONPATH
74
+ export PYTHONPATH=$ICEFALL:$PYTHONPATH
75
+
76
+ export CUDA_VISIBLE_DEVICES="0"
77
+
78
+ #left_context=32
79
+ #chunk_size=8
80
+
81
+ left_context=64
82
+ chunk_size=16
83
+
84
+ for right in 0 2 4 8; do
85
+ ./pruned_transducer_stateless4/streaming_decode.py \
86
+ --left-context ${left_context} \
87
+ --decode-chunk-size ${chunk_size} \
88
+ --right-context ${right} \
89
+ --exp-dir ./pruned_transducer_stateless4/exp \
90
+ --use-averaged-model 1 \
91
+ --epoch 29 \
92
+ --avg 6 \
93
+ --num-decode-streams 1000
94
+ done
95
+ ```
96
+
97
+ ### export
98
+ for pretrained.pt
99
+ ```
100
+ python pruned_transducer_stateless4/export.py \
101
+ --exp-dir ./pruned_transducer_stateless4/exp \
102
+ --epoch 29 \
103
+ --avg 6 \
104
+ --streaming-model 1 \
105
+ --causal-convolution 1
106
+ ```
107
+ for cpu_jit.pt
108
+ ```
109
+ python pruned_transducer_stateless4/export.py \
110
+ --exp-dir ./pruned_transducer_stateless4/exp \
111
+ --epoch 29 \
112
+ --avg 6 \
113
+ --streaming-model 1 \
114
+ --causal-convolution 1 \
115
+ --jit 1
116
+ ```
117
  ---
118
  license: apache-2.0
119
  ---