Instructions to use Xenova/mms-lid-1024 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use Xenova/mms-lid-1024 with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('audio-classification', 'Xenova/mms-lid-1024');
Add/update the quantized ONNX model files and README.md for Transformers.js v3
#2
by whitphx - opened
- README.md +17 -0
- onnx/model_bnb4.onnx +3 -0
- onnx/model_q4.onnx +3 -0
- onnx/model_q4f16.onnx +3 -0
- onnx/model_uint8.onnx +3 -0
README.md
CHANGED
|
@@ -7,4 +7,21 @@ tags:
|
|
| 7 |
|
| 8 |
https://huggingface.co/facebook/mms-lid-1024 with ONNX weights to be compatible with Transformers.js.
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
Note: Having a separate repo for ONNX weights is intended to be a temporary solution until WebML gains more traction. If you would like to make your models web-ready, we recommend converting to ONNX using [π€ Optimum](https://huggingface.co/docs/optimum/index) and structuring your repo like this one (with ONNX weights located in a subfolder named `onnx`).
|
|
|
|
| 7 |
|
| 8 |
https://huggingface.co/facebook/mms-lid-1024 with ONNX weights to be compatible with Transformers.js.
|
| 9 |
|
| 10 |
+
## Usage (Transformers.js)
|
| 11 |
+
|
| 12 |
+
If you haven't already, you can install the [Transformers.js](https://huggingface.co/docs/transformers.js) JavaScript library from [NPM](https://www.npmjs.com/package/@huggingface/transformers) using:
|
| 13 |
+
```bash
|
| 14 |
+
npm i @huggingface/transformers
|
| 15 |
+
```
|
| 16 |
+
|
| 17 |
+
**Example:** Perform language identification.
|
| 18 |
+
|
| 19 |
+
```js
|
| 20 |
+
import { pipeline } from '@huggingface/transformers';
|
| 21 |
+
|
| 22 |
+
const classifier = await pipeline('audio-classification', 'Xenova/mms-lid-1024');
|
| 23 |
+
const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/jfk.wav';
|
| 24 |
+
const output = await classifier(url);
|
| 25 |
+
```
|
| 26 |
+
|
| 27 |
Note: Having a separate repo for ONNX weights is intended to be a temporary solution until WebML gains more traction. If you would like to make your models web-ready, we recommend converting to ONNX using [π€ Optimum](https://huggingface.co/docs/optimum/index) and structuring your repo like this one (with ONNX weights located in a subfolder named `onnx`).
|
onnx/model_bnb4.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4d8134950446ef6109b1a95ddf352764d0a17da69d40ac61bd41dc71e15e39d5
|
| 3 |
+
size 611405227
|
onnx/model_q4.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b659675a71982d9322ebe7499dd3083cb5592d69db53b50d4c9980c4db2e9133
|
| 3 |
+
size 671244796
|
onnx/model_q4f16.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7b2c4865630f7746b1c4ced026500ddb4522f601b5c0826a8c625eaade82a8a8
|
| 3 |
+
size 573609518
|
onnx/model_uint8.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b9e61b34b3c20e9a1604dec8139ce11c71f8f275423df85ad21ba76a16c14a6d
|
| 3 |
+
size 971427695
|