text classification
distilbert-base-uncased-finetuned-sst-2-english
by distilbert
language: en
2,633,833 downloads979 likes
Get API KeyAPI Usage
Endpoint
POST https://api.gpu.fm/v1/inferenceRequest
curl -X POST https://api.gpu.fm/v1/inference \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "distilbert-base-uncased-finetuned-sst-2-english",
"inputs": "Your input here",
"parameters": {
"max_new_tokens": 256
}
}'Response
{
"result": "Model output",
"usage": {
"inputTokens": 12,
"outputTokens": 128
},
"pricing": {
"total": "0.000018"
}
}Python SDK
import requests
response = requests.post(
"https://api.gpu.fm/v1/inference",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"model": "distilbert-base-uncased-finetuned-sst-2-english",
"inputs": "Your input here",
"parameters": {"max_new_tokens": 256}
}
)
result = response.json()
print(result["result"])Model Documentation
Full documentation available on HuggingFace →
Pricing
Per Request$0.00015
Billed from your prepaid credits. No minimum commitment.
Details
- Model ID
- distilbert-base-uncased-finetuned-sst-2-english
- Library
- transformers
- Pipeline
- text classification
- Updated
- 12/19/2023
Tags
transformerspytorchtfrustonnxsafetensorsdistilberttext-classificationendataset:sst2