- Cloudflare ホスト
- 非推奨
BART は、双方向(BERT ライク)のエンコーダーと自己回帰(GPT ライク)のデコーダーを備えた transformer encoder-encoder(seq2seq)モデルです。テキストの要約に使えます。
| モデル情報 | |
|---|---|
| 非推奨 | 2026/5/30 |
| ベータ | はい |
| 単価 | $0.00 per M input tokens |
export interface Env {
AI: Ai;
}
export default {
async fetch(request, env): Promise<Response> {
const response = await env.AI.run("@cf/facebook/bart-large-cnn", {
input_text: "Workers AI allows you to run machine learning models, on the Cloudflare network, from your own code – whether that be from Workers, Pages, or anywhere via the Cloudflare API. With the launch of Workers AI, Cloudflare is slowly rolling out GPUs to its global network. This enables you to build and deploy ambitious AI applications that run near your users, wherever they are.",
max_length: 14
});
return Response.json(response);
},
} satisfies ExportedHandler<Env>;
curl https://api.cloudflare.com/client/v4/accounts/{cf_account_id}/ai/run/@cf/facebook/bart-large-cnn \
-H "Authorization: Bearer {cf_api_token}" \
-d '{
"input_text": "Workers AI allows you to run machine learning models, on the Cloudflare network, from your own code – whether that be from Workers, Pages, or anywhere via the Cloudflare API. With the launch of Workers AI, Cloudflare is slowly rolling out GPUs to its global network. This enables you to build and deploy ambitious AI applications that run near your users, wherever they are.",
"max_length": 14
}'input_text
string必須minLength: 1モデルに要約させたいテキストですmax_length
integerデフォルト: 1024生成する要約の最大長(トークン)ですsummary
string入力テキストの要約です