qaihm-bot commited on
Commit
7f6e399
·
verified ·
1 Parent(s): 7a2456b

See https://github.com/quic/ai-hub-models/releases/v0.46.1 for changelog.

HuggingFace-WavLM-Base-Plus_float.onnx.zip DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:42c70ec3d64ad59c4a94498c4d7e340baef68cb7857bd538cdc258fa52873528
3
- size 347488644
 
 
 
 
HuggingFace-WavLM-Base-Plus_float.tflite DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:e7d93071333260f75fe2c64691ee28e0ee64259191d45d6e19568c7f5c86240b
3
- size 389713836
 
 
 
 
README.md CHANGED
@@ -10,234 +10,79 @@ pipeline_tag: automatic-speech-recognition
10
 
11
  ![](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/huggingface_wavlm_base_plus/web-assets/model_demo.png)
12
 
13
- # HuggingFace-WavLM-Base-Plus: Optimized for Mobile Deployment
14
- ## Real-time Speech processing
15
-
16
 
17
  HuggingFaceWavLMBasePlus is a real time speech processing backbone based on Microsoft's WavLM model.
18
 
19
- This model is an implementation of HuggingFace-WavLM-Base-Plus found [here](https://huggingface.co/patrickvonplaten/wavlm-libri-clean-100h-base-plus/tree/main).
20
-
21
-
22
- This repository provides scripts to run HuggingFace-WavLM-Base-Plus on Qualcomm® devices.
23
- More details on model performance across various devices, can be found
24
- [here](https://aihub.qualcomm.com/models/huggingface_wavlm_base_plus).
25
-
26
-
27
-
28
- ### Model Details
29
-
30
- - **Model Type:** Model_use_case.speech_recognition
31
- - **Model Stats:**
32
- - Model checkpoint: wavlm-libri-clean-100h-base-plus
33
- - Input resolution: 1x320000
34
- - Number of parameters: 95.1M
35
- - Model size (float): 363 MB
36
-
37
- | Model | Precision | Device | Chipset | Target Runtime | Inference Time (ms) | Peak Memory Range (MB) | Primary Compute Unit | Target Model
38
- |---|---|---|---|---|---|---|---|---|
39
- | HuggingFace-WavLM-Base-Plus | float | QCS8275 (Proxy) | Qualcomm® QCS8275 (Proxy) | TFLITE | 2850.168 ms | 125 - 967 MB | CPU | [HuggingFace-WavLM-Base-Plus.tflite](https://huggingface.co/qualcomm/HuggingFace-WavLM-Base-Plus/blob/main/HuggingFace-WavLM-Base-Plus.tflite) |
40
- | HuggingFace-WavLM-Base-Plus | float | QCS8450 (Proxy) | Qualcomm® QCS8450 (Proxy) | TFLITE | 2337.235 ms | 0 - 1268 MB | CPU | [HuggingFace-WavLM-Base-Plus.tflite](https://huggingface.co/qualcomm/HuggingFace-WavLM-Base-Plus/blob/main/HuggingFace-WavLM-Base-Plus.tflite) |
41
- | HuggingFace-WavLM-Base-Plus | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | TFLITE | 1560.836 ms | 125 - 128 MB | CPU | [HuggingFace-WavLM-Base-Plus.tflite](https://huggingface.co/qualcomm/HuggingFace-WavLM-Base-Plus/blob/main/HuggingFace-WavLM-Base-Plus.tflite) |
42
- | HuggingFace-WavLM-Base-Plus | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | ONNX | 289.504 ms | 0 - 227 MB | NPU | [HuggingFace-WavLM-Base-Plus.onnx.zip](https://huggingface.co/qualcomm/HuggingFace-WavLM-Base-Plus/blob/main/HuggingFace-WavLM-Base-Plus.onnx.zip) |
43
- | HuggingFace-WavLM-Base-Plus | float | QCS9075 (Proxy) | Qualcomm® QCS9075 (Proxy) | TFLITE | 2262.782 ms | 126 - 968 MB | CPU | [HuggingFace-WavLM-Base-Plus.tflite](https://huggingface.co/qualcomm/HuggingFace-WavLM-Base-Plus/blob/main/HuggingFace-WavLM-Base-Plus.tflite) |
44
- | HuggingFace-WavLM-Base-Plus | float | SA7255P ADP | Qualcomm® SA7255P | TFLITE | 2850.168 ms | 125 - 967 MB | CPU | [HuggingFace-WavLM-Base-Plus.tflite](https://huggingface.co/qualcomm/HuggingFace-WavLM-Base-Plus/blob/main/HuggingFace-WavLM-Base-Plus.tflite) |
45
- | HuggingFace-WavLM-Base-Plus | float | SA8295P ADP | Qualcomm® SA8295P | TFLITE | 2075.065 ms | 125 - 1067 MB | CPU | [HuggingFace-WavLM-Base-Plus.tflite](https://huggingface.co/qualcomm/HuggingFace-WavLM-Base-Plus/blob/main/HuggingFace-WavLM-Base-Plus.tflite) |
46
- | HuggingFace-WavLM-Base-Plus | float | SA8775P ADP | Qualcomm® SA8775P | TFLITE | 2262.782 ms | 126 - 968 MB | CPU | [HuggingFace-WavLM-Base-Plus.tflite](https://huggingface.co/qualcomm/HuggingFace-WavLM-Base-Plus/blob/main/HuggingFace-WavLM-Base-Plus.tflite) |
47
- | HuggingFace-WavLM-Base-Plus | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | TFLITE | 1380.118 ms | 117 - 1244 MB | CPU | [HuggingFace-WavLM-Base-Plus.tflite](https://huggingface.co/qualcomm/HuggingFace-WavLM-Base-Plus/blob/main/HuggingFace-WavLM-Base-Plus.tflite) |
48
- | HuggingFace-WavLM-Base-Plus | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | ONNX | 216.184 ms | 0 - 1403 MB | NPU | [HuggingFace-WavLM-Base-Plus.onnx.zip](https://huggingface.co/qualcomm/HuggingFace-WavLM-Base-Plus/blob/main/HuggingFace-WavLM-Base-Plus.onnx.zip) |
49
- | HuggingFace-WavLM-Base-Plus | float | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | TFLITE | 1024.104 ms | 125 - 833 MB | CPU | [HuggingFace-WavLM-Base-Plus.tflite](https://huggingface.co/qualcomm/HuggingFace-WavLM-Base-Plus/blob/main/HuggingFace-WavLM-Base-Plus.tflite) |
50
- | HuggingFace-WavLM-Base-Plus | float | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | ONNX | 189.5 ms | 1 - 1008 MB | NPU | [HuggingFace-WavLM-Base-Plus.onnx.zip](https://huggingface.co/qualcomm/HuggingFace-WavLM-Base-Plus/blob/main/HuggingFace-WavLM-Base-Plus.onnx.zip) |
51
- | HuggingFace-WavLM-Base-Plus | float | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | TFLITE | 923.379 ms | 101 - 1107 MB | CPU | [HuggingFace-WavLM-Base-Plus.tflite](https://huggingface.co/qualcomm/HuggingFace-WavLM-Base-Plus/blob/main/HuggingFace-WavLM-Base-Plus.tflite) |
52
- | HuggingFace-WavLM-Base-Plus | float | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | ONNX | 154.769 ms | 1 - 1053 MB | NPU | [HuggingFace-WavLM-Base-Plus.onnx.zip](https://huggingface.co/qualcomm/HuggingFace-WavLM-Base-Plus/blob/main/HuggingFace-WavLM-Base-Plus.onnx.zip) |
53
- | HuggingFace-WavLM-Base-Plus | float | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 295.114 ms | 202 - 202 MB | NPU | [HuggingFace-WavLM-Base-Plus.onnx.zip](https://huggingface.co/qualcomm/HuggingFace-WavLM-Base-Plus/blob/main/HuggingFace-WavLM-Base-Plus.onnx.zip) |
54
-
55
-
56
-
57
-
58
- ## Installation
59
-
60
-
61
- Install the package via pip:
62
- ```bash
63
- # NOTE: 3.10 <= PYTHON_VERSION < 3.14 is supported.
64
- pip install "qai-hub-models[huggingface-wavlm-base-plus]"
65
- ```
66
-
67
-
68
- ## Configure Qualcomm® AI Hub Workbench to run this model on a cloud-hosted device
69
-
70
- Sign-in to [Qualcomm® AI Hub Workbench](https://workbench.aihub.qualcomm.com/) with your
71
- Qualcomm® ID. Once signed in navigate to `Account -> Settings -> API Token`.
72
-
73
- With this API token, you can configure your client to run models on the cloud
74
- hosted devices.
75
- ```bash
76
- qai-hub configure --api_token API_TOKEN
77
- ```
78
- Navigate to [docs](https://workbench.aihub.qualcomm.com/docs/) for more information.
79
-
80
-
81
-
82
- ## Demo off target
83
-
84
- The package contains a simple end-to-end demo that downloads pre-trained
85
- weights and runs this model on a sample input.
86
-
87
- ```bash
88
- python -m qai_hub_models.models.huggingface_wavlm_base_plus.demo
89
- ```
90
-
91
- The above demo runs a reference implementation of pre-processing, model
92
- inference, and post processing.
93
-
94
- **NOTE**: If you want running in a Jupyter Notebook or Google Colab like
95
- environment, please add the following to your cell (instead of the above).
96
- ```
97
- %run -m qai_hub_models.models.huggingface_wavlm_base_plus.demo
98
- ```
99
-
100
-
101
- ### Run model on a cloud-hosted device
102
-
103
- In addition to the demo, you can also run the model on a cloud-hosted Qualcomm®
104
- device. This script does the following:
105
- * Performance check on-device on a cloud-hosted device
106
- * Downloads compiled assets that can be deployed on-device for Android.
107
- * Accuracy check between PyTorch and on-device outputs.
108
-
109
- ```bash
110
- python -m qai_hub_models.models.huggingface_wavlm_base_plus.export
111
- ```
112
 
 
113
 
 
 
114
 
115
- ## How does this work?
116
 
117
- This [export script](https://aihub.qualcomm.com/models/huggingface_wavlm_base_plus/qai_hub_models/models/HuggingFace-WavLM-Base-Plus/export.py)
118
- leverages [Qualcomm® AI Hub](https://aihub.qualcomm.com/) to optimize, validate, and deploy this model
119
- on-device. Lets go through each step below in detail:
120
 
121
- Step 1: **Compile model for on-device deployment**
 
 
 
122
 
123
- To compile a PyTorch model for on-device deployment, we first trace the model
124
- in memory using the `jit.trace` and then call the `submit_compile_job` API.
125
 
126
- ```python
127
- import torch
128
 
129
- import qai_hub as hub
130
- from qai_hub_models.models.huggingface_wavlm_base_plus import Model
131
 
132
- # Load the model
133
- torch_model = Model.from_pretrained()
 
 
134
 
135
- # Device
136
- device = hub.Device("Samsung Galaxy S25")
137
 
138
- # Trace model
139
- input_shape = torch_model.get_input_spec()
140
- sample_inputs = torch_model.sample_inputs()
141
 
142
- pt_model = torch.jit.trace(torch_model, [torch.tensor(data[0]) for _, data in sample_inputs.items()])
143
 
144
- # Compile model on a specific device
145
- compile_job = hub.submit_compile_job(
146
- model=pt_model,
147
- device=device,
148
- input_specs=torch_model.get_input_spec(),
149
- )
150
 
151
- # Get target model to run on-device
152
- target_model = compile_job.get_target_model()
153
-
154
- ```
155
-
156
-
157
- Step 2: **Performance profiling on cloud-hosted device**
158
-
159
- After compiling models from step 1. Models can be profiled model on-device using the
160
- `target_model`. Note that this scripts runs the model on a device automatically
161
- provisioned in the cloud. Once the job is submitted, you can navigate to a
162
- provided job URL to view a variety of on-device performance metrics.
163
- ```python
164
- profile_job = hub.submit_profile_job(
165
- model=target_model,
166
- device=device,
167
- )
168
-
169
- ```
170
-
171
- Step 3: **Verify on-device accuracy**
172
-
173
- To verify the accuracy of the model on-device, you can run on-device inference
174
- on sample input data on the same cloud hosted device.
175
- ```python
176
- input_data = torch_model.sample_inputs()
177
- inference_job = hub.submit_inference_job(
178
- model=target_model,
179
- device=device,
180
- inputs=input_data,
181
- )
182
- on_device_output = inference_job.download_output_data()
183
-
184
- ```
185
- With the output of the model, you can compute like PSNR, relative errors or
186
- spot check the output with expected output.
187
-
188
- **Note**: This on-device profiling and inference requires access to Qualcomm®
189
- AI Hub Workbench. [Sign up for access](https://myaccount.qualcomm.com/signup).
190
-
191
-
192
-
193
- ## Run demo on a cloud-hosted device
194
-
195
- You can also run the demo on-device.
196
-
197
- ```bash
198
- python -m qai_hub_models.models.huggingface_wavlm_base_plus.demo --eval-mode on-device
199
- ```
200
-
201
- **NOTE**: If you want running in a Jupyter Notebook or Google Colab like
202
- environment, please add the following to your cell (instead of the above).
203
- ```
204
- %run -m qai_hub_models.models.huggingface_wavlm_base_plus.demo -- --eval-mode on-device
205
- ```
206
-
207
-
208
- ## Deploying compiled model to Android
209
-
210
-
211
- The models can be deployed using multiple runtimes:
212
- - TensorFlow Lite (`.tflite` export): [This
213
- tutorial](https://www.tensorflow.org/lite/android/quickstart) provides a
214
- guide to deploy the .tflite model in an Android application.
215
-
216
-
217
- - QNN (`.so` export ): This [sample
218
- app](https://docs.qualcomm.com/bundle/publicresource/topics/80-63442-50/sample_app.html)
219
- provides instructions on how to use the `.so` shared library in an Android application.
220
-
221
-
222
- ## View on Qualcomm® AI Hub
223
- Get more details on HuggingFace-WavLM-Base-Plus's performance across various devices [here](https://aihub.qualcomm.com/models/huggingface_wavlm_base_plus).
224
- Explore all available models on [Qualcomm® AI Hub](https://aihub.qualcomm.com/)
225
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
226
 
227
  ## License
228
  * The license for the original implementation of HuggingFace-WavLM-Base-Plus can be found
229
  [here](https://github.com/microsoft/unilm/blob/master/LICENSE).
230
 
231
-
232
-
233
  ## References
234
  * [WavLM: Large-Scale Self-Supervised Pre-Training for Full Stack Speech Processing](https://arxiv.org/abs/2110.13900)
235
  * [Source Model Implementation](https://huggingface.co/patrickvonplaten/wavlm-libri-clean-100h-base-plus/tree/main)
236
 
237
-
238
-
239
  ## Community
240
  * Join [our AI Hub Slack community](https://aihub.qualcomm.com/community/slack) to collaborate, post questions and learn more about on-device AI.
241
  * For questions or feedback please [reach out to us](mailto:ai-hub-support@qti.qualcomm.com).
242
-
243
-
 
10
 
11
  ![](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/huggingface_wavlm_base_plus/web-assets/model_demo.png)
12
 
13
+ # HuggingFace-WavLM-Base-Plus: Optimized for Qualcomm Devices
 
 
14
 
15
  HuggingFaceWavLMBasePlus is a real time speech processing backbone based on Microsoft's WavLM model.
16
 
17
+ This is based on the implementation of HuggingFace-WavLM-Base-Plus found [here](https://huggingface.co/patrickvonplaten/wavlm-libri-clean-100h-base-plus/tree/main).
18
+ This repository contains pre-exported model files optimized for Qualcomm® devices. You can use the [Qualcomm® AI Hub Models](https://github.com/quic/ai-hub-models/blob/main/qai_hub_models/models/huggingface_wavlm_base_plus) library to export with custom configurations. More details on model performance across various devices, can be found [here](#performance-summary).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
 
20
+ Qualcomm AI Hub Models uses [Qualcomm AI Hub Workbench](https://workbench.aihub.qualcomm.com) to compile, profile, and evaluate this model. [Sign up](https://myaccount.qualcomm.com/signup) to run these models on a hosted Qualcomm® device.
21
 
22
+ ## Getting Started
23
+ There are two ways to deploy this model on your device:
24
 
25
+ ### Option 1: Download Pre-Exported Models
26
 
27
+ Below are pre-exported model assets ready for deployment.
 
 
28
 
29
+ | Runtime | Precision | Chipset | SDK Versions | Download |
30
+ |---|---|---|---|---|
31
+ | ONNX | float | Universal | QAIRT 2.37, ONNX Runtime 1.23.0 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/huggingface_wavlm_base_plus/releases/v0.46.1/huggingface_wavlm_base_plus-onnx-float.zip)
32
+ | TFLITE | float | Universal | TFLite 2.17.0 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/huggingface_wavlm_base_plus/releases/v0.46.1/huggingface_wavlm_base_plus-tflite-float.zip)
33
 
34
+ For more device-specific assets and performance metrics, visit **[HuggingFace-WavLM-Base-Plus on Qualcomm® AI Hub](https://aihub.qualcomm.com/models/huggingface_wavlm_base_plus)**.
 
35
 
 
 
36
 
37
+ ### Option 2: Export with Custom Configurations
 
38
 
39
+ Use the [Qualcomm® AI Hub Models](https://github.com/quic/ai-hub-models/blob/main/qai_hub_models/models/huggingface_wavlm_base_plus) Python library to compile and export the model with your own:
40
+ - Custom weights (e.g., fine-tuned checkpoints)
41
+ - Custom input shapes
42
+ - Target device and runtime configurations
43
 
44
+ This option is ideal if you need to customize the model beyond the default configuration provided here.
 
45
 
46
+ See our repository for [HuggingFace-WavLM-Base-Plus on GitHub](https://github.com/quic/ai-hub-models/blob/main/qai_hub_models/models/huggingface_wavlm_base_plus) for usage instructions.
 
 
47
 
48
+ ## Model Details
49
 
50
+ **Model Type:** Model_use_case.speech_recognition
 
 
 
 
 
51
 
52
+ **Model Stats:**
53
+ - Model checkpoint: wavlm-libri-clean-100h-base-plus
54
+ - Input resolution: 1x320000
55
+ - Number of parameters: 95.1M
56
+ - Model size (float): 363 MB
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
 
58
+ ## Performance Summary
59
+ | Model | Runtime | Precision | Chipset | Inference Time (ms) | Peak Memory Range (MB) | Primary Compute Unit
60
+ |---|---|---|---|---|---|---
61
+ | HuggingFace-WavLM-Base-Plus | ONNX | float | Snapdragon® X Elite | 295.294 ms | 202 - 202 MB | NPU
62
+ | HuggingFace-WavLM-Base-Plus | ONNX | float | Snapdragon® 8 Gen 3 Mobile | 219.292 ms | 1 - 1404 MB | NPU
63
+ | HuggingFace-WavLM-Base-Plus | ONNX | float | Qualcomm® QCS8550 (Proxy) | 287.875 ms | 1 - 4 MB | NPU
64
+ | HuggingFace-WavLM-Base-Plus | ONNX | float | Qualcomm® QCS9075 | 280.599 ms | 1 - 4 MB | NPU
65
+ | HuggingFace-WavLM-Base-Plus | ONNX | float | Snapdragon® 8 Elite For Galaxy Mobile | 188.641 ms | 1 - 1006 MB | NPU
66
+ | HuggingFace-WavLM-Base-Plus | ONNX | float | Snapdragon® 8 Elite Gen 5 Mobile | 154.394 ms | 1 - 1057 MB | NPU
67
+ | HuggingFace-WavLM-Base-Plus | TFLITE | float | Snapdragon® 8 Gen 3 Mobile | 1421.172 ms | 117 - 1306 MB | CPU
68
+ | HuggingFace-WavLM-Base-Plus | TFLITE | float | Qualcomm® QCS8275 (Proxy) | 2905.625 ms | 125 - 1049 MB | CPU
69
+ | HuggingFace-WavLM-Base-Plus | TFLITE | float | Qualcomm® QCS8550 (Proxy) | 1557.459 ms | 127 - 756 MB | CPU
70
+ | HuggingFace-WavLM-Base-Plus | TFLITE | float | Qualcomm® SA8775P | 2260.664 ms | 125 - 1048 MB | CPU
71
+ | HuggingFace-WavLM-Base-Plus | TFLITE | float | Qualcomm® QCS9075 | 2287.921 ms | 125 - 710 MB | CPU
72
+ | HuggingFace-WavLM-Base-Plus | TFLITE | float | Qualcomm® QCS8450 (Proxy) | 2070.43 ms | 0 - 1289 MB | CPU
73
+ | HuggingFace-WavLM-Base-Plus | TFLITE | float | Qualcomm® SA7255P | 2905.625 ms | 125 - 1049 MB | CPU
74
+ | HuggingFace-WavLM-Base-Plus | TFLITE | float | Qualcomm® SA8295P | 1998.746 ms | 125 - 1108 MB | CPU
75
+ | HuggingFace-WavLM-Base-Plus | TFLITE | float | Snapdragon® 8 Elite For Galaxy Mobile | 1051.778 ms | 32 - 771 MB | CPU
76
+ | HuggingFace-WavLM-Base-Plus | TFLITE | float | Snapdragon® 8 Elite Gen 5 Mobile | 907.495 ms | 124 - 1277 MB | CPU
77
 
78
  ## License
79
  * The license for the original implementation of HuggingFace-WavLM-Base-Plus can be found
80
  [here](https://github.com/microsoft/unilm/blob/master/LICENSE).
81
 
 
 
82
  ## References
83
  * [WavLM: Large-Scale Self-Supervised Pre-Training for Full Stack Speech Processing](https://arxiv.org/abs/2110.13900)
84
  * [Source Model Implementation](https://huggingface.co/patrickvonplaten/wavlm-libri-clean-100h-base-plus/tree/main)
85
 
 
 
86
  ## Community
87
  * Join [our AI Hub Slack community](https://aihub.qualcomm.com/community/slack) to collaborate, post questions and learn more about on-device AI.
88
  * For questions or feedback please [reach out to us](mailto:ai-hub-support@qti.qualcomm.com).
 
 
tool-versions.yaml DELETED
@@ -1,4 +0,0 @@
1
- tool_versions:
2
- onnx:
3
- qairt: 2.37.1.250807093845_124904
4
- onnx_runtime: 1.23.0