Skip to content
HuggingFace logo

distilbert-sst-2-int8

Text ClassificationHuggingFaceHosted

Distilled BERT model that was finetuned on SST-2 for sentiment classification

Model Info
More informationlink
Unit Pricing$0.026 per M input tokens

Usage

export interface Env {
AI: Ai;
}
export default {
async fetch(request, env): Promise<Response> {
const response = await env.AI.run(
"@cf/huggingface/distilbert-sst-2-int8",
{
text: "This pizza is great!",
}
);
return Response.json(response);
},
} satisfies ExportedHandler<Env>;

Parameters

text
stringrequiredminLength: 1The text that you want to classify

API Schemas

{
"type": "object",
"properties": {
"text": {
"type": "string",
"minLength": 1,
"description": "The text that you want to classify"
}
},
"required": [
"text"
]
}