Xenova HF staff commited on
Commit
9410179
1 Parent(s): 0343bfb

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +7 -4
README.md CHANGED
@@ -15,10 +15,13 @@ npm i @xenova/transformers
15
 
16
  **Example:** Perform zero-shot audio classification with `Xenova/clap-htsat-unfused`.
17
  ```js
18
- let classifier = await pipeline('zero-shot-audio-classification', 'Xenova/clap-htsat-unfused');
19
- let audio = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/dog_barking.wav';
20
- let candidate_labels = ['dog', 'vaccum cleaner'];
21
- let scores = await classifier(audio, candidate_labels);
 
 
 
22
  // [
23
  // { score: 0.9993992447853088, label: 'dog' },
24
  // { score: 0.0006007603369653225, label: 'vaccum cleaner' }
 
15
 
16
  **Example:** Perform zero-shot audio classification with `Xenova/clap-htsat-unfused`.
17
  ```js
18
+ import { pipeline } from '@xenova/transformers';
19
+
20
+ const classifier = await pipeline('zero-shot-audio-classification', 'Xenova/clap-htsat-unfused');
21
+
22
+ const audio = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/dog_barking.wav';
23
+ const candidate_labels = ['dog', 'vaccum cleaner'];
24
+ const scores = await classifier(audio, candidate_labels);
25
  // [
26
  // { score: 0.9993992447853088, label: 'dog' },
27
  // { score: 0.0006007603369653225, label: 'vaccum cleaner' }