We are going to use requests to send our requests. (make your you have it installed
pip install requests
)
import json
import requests as r
ENDPOINT_URL=""# url of your endpoint
HF_TOKEN=""# payload samples
regular_payload = { "inputs": "Coming to The Rescue Got a unique problem? Not to worry: you can find a financial planner for every specialized need"}
# HTTP headers for authorization
headers= {
"Authorization": f"Bearer {HF_TOKEN}",
"Content-Type": "application/json"
}
# send request
response = r.post(ENDPOINT_URL, headers=headers, json=paramter_payload)
classified = response.json()
print(classified)
# [ { "label": "World", "score": 0.12341519122860946 }, { "label": "Sports", "score": 0.11741269832494523 }, { "label": "Business", "score": 0.6124446065942992 }, { "label": "Sci/Tech", "score": 0.14672750385214603 } ]
curl example
curl https://YOURDOMAIN.us-east-1.aws.endpoints.huggingface.cloud \
-X POST \
-d '{"inputs": "Coming to The Rescue Got a unique problem? Not to worry: you can find a financial planner for every specialized need"}' \
-H "Authorization: Bearer XXX" \
-H "Content-Type: application/json"
Runs of philschmid setfit-ag-news-endpoint on huggingface.co
16
Total runs
0
24-hour runs
0
3-day runs
2
7-day runs
1
30-day runs
More Information About setfit-ag-news-endpoint huggingface.co Model
setfit-ag-news-endpoint huggingface.co is an AI model on huggingface.co that provides setfit-ag-news-endpoint's model effect (), which can be used instantly with this philschmid setfit-ag-news-endpoint model. huggingface.co supports a free trial of the setfit-ag-news-endpoint model, and also provides paid use of the setfit-ag-news-endpoint. Support call setfit-ag-news-endpoint model through api, including Node.js, Python, http.
setfit-ag-news-endpoint huggingface.co is an online trial and call api platform, which integrates setfit-ag-news-endpoint's modeling effects, including api services, and provides a free online trial of setfit-ag-news-endpoint, you can try setfit-ag-news-endpoint online for free by clicking the link below.
philschmid setfit-ag-news-endpoint online free url in huggingface.co:
setfit-ag-news-endpoint is an open source model from GitHub that offers a free installation service, and any user can find setfit-ag-news-endpoint on GitHub to install. At the same time, huggingface.co provides the effect of setfit-ag-news-endpoint install, users can directly use setfit-ag-news-endpoint installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
setfit-ag-news-endpoint install url in huggingface.co: