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
+11-13Lines changed: 11 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ Spoken audio comes in different languages and this sample uses a model to identi
17
17
18
18
| Optimized for | Description
19
19
|:--- |:---
20
-
| OS | Ubuntu*18.04 or newer
20
+
| OS | Ubuntu*22.04 or newer
21
21
| Hardware | Intel® Xeon® processor family
22
22
| Software | Intel® OneAPI AI Analytics Toolkit <br> Hugging Face SpeechBrain
23
23
@@ -51,7 +51,7 @@ For this sample, you will need to download the following languages: **Japanese**
51
51
2. Enter your email.
52
52
3. Check the boxes, and right-click on the download button to copy the link address.
53
53
4. Paste this link into a text editor and copy the first part of the URL up to ".tar.gz".
54
-
5. Use **GNU wget** on the URL to download the data to `/data/commonVoice`.
54
+
5. Use **GNU wget** on the URL to download the data to `/data/commonVoice` or a folder of your choice.
55
55
56
56
Alternatively, you can use a directory on your local drive due to the large amount of data.
57
57
@@ -93,7 +93,7 @@ Then activate your environment:
93
93
conda activate <your-env-name>
94
94
```
95
95
96
-
2. Set the environment variable `COMMON_VOICE_PATH`
96
+
2. Set the environment variable `COMMON_VOICE_PATH`. This needs to match with where you downloaded your dataset.
97
97
```bash
98
98
export COMMON_VOICE_PATH=/data/commonVoice
99
99
```
@@ -263,10 +263,6 @@ To run inference, you must have already run all of the training scripts, generat
263
263
```
264
264
cd /Inference
265
265
```
266
-
2. Patch SpeechBrain's `interfaces.py`. This patch is required for PyTorch* TorchScript to work because the output of the model must contain only tensors.
@@ -328,7 +324,7 @@ Both scripts support input options; however, some options can be use on `inferen
328
324
To run inference on custom data, you must specify a folder with **.wav** files and pass the path in as an argument. You can do so by creating a folder named `data_custom` and then copy 1 or 2 **.wav** files from your test dataset into it. **.mp3** files will NOT work.
329
325
330
326
Run the inference_ script.
331
-
```
327
+
```bash
332
328
python inference_custom.py -p <path_to_folder>
333
329
```
334
330
@@ -337,13 +333,13 @@ The following examples describe how to use the scripts to produce specific outco
337
333
**Default: Random Selections**
338
334
339
335
1. To randomly select audio clips from audio files for prediction, enter commands similar to the following:
This will apply `ipex.optimize` to the model(s) and TorchScript. You can also add the `--bf16` option along with `--ipex` to run in the BF16 data type, supported on 4th Gen Intel® Xeon® Scalable processors and newer.
356
+
359
357
>**Note**: The `--verbose` option is required to view the latency measurements.
360
358
361
359
**Quantization with Intel® Neural Compressor (INC)**
362
360
363
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 `/data/commonVoice/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/dev` folder that was generated from the data preprocessing scripts in the `Training` folder.
368
366
369
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:
0 commit comments