You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AI-and-Analytics/End-to-end-Workloads/LanguageIdentification/README.md
+9-6Lines changed: 9 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -360,9 +360,9 @@ The following examples describe how to use the scripts to produce specific outco
360
360
361
361
1. To improve inference latency, you can use the Intel® Neural Compressor (INC) to quantize the trained model from FP32 to INT8 by running `quantize_model.py`.
Use the `-datapath` argument to specify a custom evaluation dataset. By default, the datapath is set to the `$COMMON_VOICE_PATH/dev` folder that was generated from the data preprocessing scripts in the `Training` folder.
365
+
Use the `-datapath` argument to specify a custom evaluation dataset. By default, the datapath is set to the `$COMMON_VOICE_PATH/processed_data/dev` folder that was generated from the data preprocessing scripts in the `Training` folder.
366
366
367
367
After quantization, the model will be stored in `lang_id_commonvoice_model_INT8` and `neural_compressor.utils.pytorch.load` will have to be used to load the quantized model for inference. If `self.language_id` is the original model and `data_path` is the path to the audio file:
368
368
```
@@ -372,13 +372,16 @@ The following examples describe how to use the scripts to produce specific outco
372
372
prediction = self.model_int8(signal)
373
373
```
374
374
375
-
**(Optional) Comparing Predictions with Ground Truth**
375
+
The code above is integrated into `inference_custom.py`. You can now run inference on your data using this INT8 model:
You can choose to modify `audio_ground_truth_labels.csv` to include the name of the audio file and expected audio label (like, `en` for English), then run `inference_custom.py` with the `--ground_truth_compare` option. By default, this is disabled.
380
+
>**Note**: The `--verbose` option is required to view the latency measurements.
378
381
379
-
### Troubleshooting
382
+
**(Optional) Comparing Predictions with Ground Truth**
380
383
381
-
If the model appears to be giving the same output regardless of input, try running `clean.sh` to remove the `RIR_NOISES` and `speechbrain` folders. Redownload that data after cleaning by running `initialize.sh` and either `inference_commonVoice.py`or `inference_custom.py`.
384
+
You can choose to modify `audio_ground_truth_labels.csv` to include the name of the audio file and expected audio label (like, `en` for English), then run `inference_custom.py`with the `--ground_truth_compare` option. By default, this is disabled.
0 commit comments