Skip to content

Commit 2639d4b

Browse files
fix Online_ASR_Microphone_Demo_Buffered_Streaming.ipynb failed with ConfigKeyError (#15964)
* add confidences to beam search + cache_aware in streaming inference Signed-off-by: lilithgrigoryan <lgrigoryan@nvidia.com> * clean up Signed-off-by: lilithgrigoryan <lgrigoryan@nvidia.com> * add logging frame confidence Signed-off-by: lilithgrigoryan <lgrigoryan@nvidia.com> * clean up Signed-off-by: lilithgrigoryan <lgrigoryan@nvidia.com> * clean up Signed-off-by: lilithgrigoryan <lgrigoryan@nvidia.com> * minor clean up Signed-off-by: lilithgrigoryan <lgrigoryan@nvidia.com> * clean uo Signed-off-by: lilithgrigoryan <lgrigoryan@nvidia.com> * minor changes Signed-off-by: lilithgrigoryan <lgrigoryan@nvidia.com> * fix tests Signed-off-by: lilithgrigoryan <lgrigoryan@nvidia.com> * minor fix Signed-off-by: lilithgrigoryan <lgrigoryan@nvidia.com> * revert compute_metrics_per_sample argument Signed-off-by: lilithgrigoryan <lgrigoryan@nvidia.com> * fix Signed-off-by: lilithgrigoryan <lgrigoryan@nvidia.com> * fix preprocessor Signed-off-by: lilithgrigoryan <lgrigoryan@nvidia.com> * clean up Signed-off-by: lilithgrigoryan <lgrigoryan@nvidia.com> --------- Signed-off-by: lilithgrigoryan <lgrigoryan@nvidia.com>
1 parent 9b9733d commit 2639d4b

1 file changed

Lines changed: 5 additions & 43 deletions

File tree

tutorials/asr/Online_ASR_Microphone_Demo_Buffered_Streaming.ipynb

Lines changed: 5 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
"3. Connect to an instance with a GPU (Runtime -> Change runtime type -> select \"GPU\" for hardware accelerator)\n",
1717
"4. Run this cell to set up dependencies.\n",
1818
"5. Set up microphone for Colab\n",
19-
"\n\nNOTE: User is responsible for checking the content of datasets and the applicable licenses and determining if suitable for the intended use.\n",
19+
"\n",
20+
"\n",
21+
"NOTE: User is responsible for checking the content of datasets and the applicable licenses and determining if suitable for the intended use.\n",
2022
"\"\"\"\n",
2123
"# If you're using Google Colab and not running locally, run this cell.\n",
2224
"\n",
@@ -150,45 +152,6 @@
150152
"cfg.preprocessor.dither = 0.0\n",
151153
"cfg.preprocessor.pad_to = 0\n",
152154
"\n",
153-
"# spectrogram normalization constants\n",
154-
"normalization = {}\n",
155-
"normalization['fixed_mean'] = [\n",
156-
" -14.95827016, -12.71798736, -11.76067913, -10.83311182,\n",
157-
" -10.6746914, -10.15163465, -10.05378331, -9.53918999,\n",
158-
" -9.41858904, -9.23382904, -9.46470918, -9.56037,\n",
159-
" -9.57434245, -9.47498732, -9.7635205, -10.08113074,\n",
160-
" -10.05454561, -9.81112681, -9.68673603, -9.83652977,\n",
161-
" -9.90046248, -9.85404766, -9.92560366, -9.95440354,\n",
162-
" -10.17162966, -9.90102482, -9.47471025, -9.54416855,\n",
163-
" -10.07109475, -9.98249912, -9.74359465, -9.55632283,\n",
164-
" -9.23399915, -9.36487649, -9.81791084, -9.56799225,\n",
165-
" -9.70630899, -9.85148006, -9.8594418, -10.01378735,\n",
166-
" -9.98505315, -9.62016094, -10.342285, -10.41070709,\n",
167-
" -10.10687659, -10.14536695, -10.30828702, -10.23542833,\n",
168-
" -10.88546868, -11.31723646, -11.46087382, -11.54877829,\n",
169-
" -11.62400934, -11.92190509, -12.14063815, -11.65130117,\n",
170-
" -11.58308531, -12.22214663, -12.42927197, -12.58039805,\n",
171-
" -13.10098969, -13.14345864, -13.31835645, -14.47345634]\n",
172-
"normalization['fixed_std'] = [\n",
173-
" 3.81402054, 4.12647781, 4.05007065, 3.87790987,\n",
174-
" 3.74721178, 3.68377423, 3.69344, 3.54001005,\n",
175-
" 3.59530412, 3.63752368, 3.62826417, 3.56488469,\n",
176-
" 3.53740577, 3.68313898, 3.67138151, 3.55707266,\n",
177-
" 3.54919572, 3.55721289, 3.56723346, 3.46029304,\n",
178-
" 3.44119672, 3.49030548, 3.39328435, 3.28244406,\n",
179-
" 3.28001423, 3.26744937, 3.46692348, 3.35378948,\n",
180-
" 2.96330901, 2.97663111, 3.04575148, 2.89717604,\n",
181-
" 2.95659301, 2.90181116, 2.7111687, 2.93041291,\n",
182-
" 2.86647897, 2.73473181, 2.71495654, 2.75543763,\n",
183-
" 2.79174615, 2.96076456, 2.57376336, 2.68789782,\n",
184-
" 2.90930817, 2.90412004, 2.76187531, 2.89905006,\n",
185-
" 2.65896173, 2.81032176, 2.87769857, 2.84665271,\n",
186-
" 2.80863137, 2.80707634, 2.83752184, 3.01914511,\n",
187-
" 2.92046439, 2.78461139, 2.90034605, 2.94599508,\n",
188-
" 2.99099718, 3.0167554, 3.04649716, 2.94116777]\n",
189-
"\n",
190-
"cfg.preprocessor.normalize = normalization\n",
191-
"\n",
192155
"# Disable config overwriting\n",
193156
"OmegaConf.set_struct(cfg.preprocessor, True)"
194157
]
@@ -344,8 +307,7 @@
344307
" self.frame_overlap = frame_overlap\n",
345308
" self.n_frame_overlap = int(frame_overlap * self.sr)\n",
346309
" timestep_duration = model_definition['AudioToMelSpectrogramPreprocessor']['window_stride']\n",
347-
" for block in model_definition['JasperEncoder']['jasper']:\n",
348-
" timestep_duration *= block['stride'][0] ** block['repeat']\n",
310+
" timestep_duration *= model_definition['JasperEncoder']['subsampling_factor']\n",
349311
" self.n_timesteps_overlap = int(frame_overlap / timestep_duration) - 2\n",
350312
" self.buffer = np.zeros(shape=2*self.n_frame_overlap + self.n_frame_len,\n",
351313
" dtype=np.float32)\n",
@@ -519,4 +481,4 @@
519481
},
520482
"nbformat": 4,
521483
"nbformat_minor": 4
522-
}
484+
}

0 commit comments

Comments
 (0)