Hi, do you know how to get more than
Hi, do you know how to get more than only 5 labels and scores as the result?
1 Reply
That's when I am doing the image classification using this example code: export interface Env {
AI: Ai;
}
export default {
async fetch(request, env): Promise<Response> {
const res = await fetch("https://cataas.com/cat");
const blob = await res.arrayBuffer();
const inputs = {
image: [...new Uint8Array(blob)],
};
const response = await env.AI.run(
"@cf/microsoft/resnet-50",
inputs
);
return new Response(JSON.stringify(response));
},
} satisfies ExportedHandler<Env>;
this model provides only first 5 results by default? how to configure it? thanks