Skip to main content

Basic usage

Send an audio file to an ASR model to generate text
import Bytez from 'bytez.js';

// insert your key
const sdk = new Bytez('BYTEZ_KEY');

// choose your model
const model = sdk.model('facebook/data2vec-audio-base-960h');

// provide the model with input
const input = {
  "url": "https://huggingface.co/datasets/huggingfacejs/tasks/resolve/main/automatic-speech-recognition/input.flac"
};

// send to the model
const { error, output } = await model.run(input);

// observe the output
console.log({ error, output });

I