Xenova HF staff commited on
Commit
5fea9f2
1 Parent(s): caeebf6

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +19 -1
README.md CHANGED
@@ -4,4 +4,22 @@ base_model:
4
  - UsefulSensors/moonshine-base
5
  library_name: transformers.js
6
  pipeline_tag: automatic-speech-recognition
7
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  - UsefulSensors/moonshine-base
5
  library_name: transformers.js
6
  pipeline_tag: automatic-speech-recognition
7
+ ---
8
+
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:** Automatic speech recognition w/ Moonshine base.
18
+ ```js
19
+ import { pipeline } from "@huggingface/transformers";
20
+
21
+ const transcriber = await pipeline("automatic-speech-recognition", "onnx-community/moonshine-base-ONNX");
22
+ const output = await transcriber("https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/jfk.wav");
23
+ console.log(output);
24
+ // { text: 'And so my fellow Americans ask not what your country can do for you as what you can do for your country.' }
25
+ ```