Using Pipeline import Pipeline from "https://esm.town/v/iamseeley/pipeline";
// ...
} else if (req.method === "POST") {
const { inputs } = await req.json();
const pipeline = new Pipeline("task", "model");
const result = await pipeline.run(inputs);
return new Response(JSON.stringify(result), { headers: { "Content-Type": "application/json" } });
}
}
exampleTranslation exampleTextClassification exampleFeatureExtraction exampleTextGeneration exampleSummarization exampleQuestionAnswering