Is there a way to use a custom model?
Is there a way to use a custom model?
sherpa-onnx, though not entirely sure how that fits in with how #workers-ai works on the backend
beta it is free for now. Any idea how much it would cost once out of beta?InferenceUpstreamError: must have required property 'prompt', must NOT have more than 6144 characters, must match exactly one schema in oneOf"InferenceUpstreamError: ERROR 3010: Invalid or incomplete input for the model: failed to decode JSON: Request is too large"


@cf/microsoft/resnet-50 and @cf/runwayml/stable-diffusion-v1-5-img2img, and believe that the same would hold for any model that accepts a large input. I used the following to test and measure:{ audio: jsArray } to { image: jsArray } and calling resnet-50 would throw the same error. [123,78,30,255,0,...]. Unless there's a limit somewhere, then at some point something has to give. In this case, there seems to be a limit of just below 10 million bytes.const srcURL = "https://cdn.openai.com/whisper/draft-20220913a/micro-machines.wav";
const res = await fetch(srcURL);
const blob = await res.arrayBuffer();
const jsArray = [...new Uint8Array(blob)];
const input = { audio: jsArray };
console.log("Blob size: " + (jsArray.length / (2 << 19)).toFixed(1) + " MB");
console.log("Input array size: " + (jsArray.length / (2 << 17)).toFixed(1) + " MB");
// ai.run() stringifies input array before calling internal fetch:
// const inpBody = JSON.stringify({ inputs: input });
// console.log("JSON size: " + (inpBody.length / (2 << 19)).toFixed(1) + " MB");
const response = await ai.run("@cf/openai/whisper", input);