I’m trying to make a call to the large-bert model to do a summary task but the response is always the same generic “CNN.com will feature iReporter photos in a weekly Travel Snapshots gallery. Please submit your best shots of the U.S. for next week. Visit CNN Travel | Global Destinations, Tips & Video next Wednesday for a new gallery of snapshots. Please share your best photos of the United States with CNN iReport.” Which has nothing to do with my test input from wikipedia.
I was wondering if there was an explanation. Am I missing some input or passing the data wrong?
The following is the attempted code using
`
const response = await fetch(
"https://api-inference.huggingface.co/models/facebook/bart-large-cnn",
{
headers: { Authorization: `Bearer ${API_TOKEN}` },
method: "POST",
data: {
"inputs": JSON.stringify(script),
"parameters": {"do_sample": false},
},
}
);
const result = await response.json();
setSummation(JSON.stringify(result[0].summary_text))
`