// Import the hook
import useTransformer from 'usetransformer'
// Create your transformer worker(s)
const transcriber = useTransformer({
task: 'automatic-speech-recognition',
model: `distil-whisper/distil-small.en`,
workerCount: 2
} as TransformerInitOperationArgs)
// Transform your data
transcriber.transform({ args: [audioBuffer] }, ({ output } : TransformerHookOutputMessage) => {
console.log(output.result.text.trim())
})
-
Notifications
You must be signed in to change notification settings - Fork 0
egeste/useTransformer
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
React hook for processing data using @xenova/transformer and web workers
Resources
Stars
Watchers
Forks
Releases
No releases published