title: HuggingFace API and ReactJS For Summary
body: <p>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 &quot;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.com/Travel next Wednesday for a new gallery of snapshots. Please share your best photos of the United States with CNN iReport.&quot; Which has nothing to do with my test input from wikipedia. I tried modeling my code off of &quot;https://api-inference.huggingface.co/docs/node/html/detailed_parameters.html#summarization-task&quot; which is more specific to nodeJS but I figured should be very similar.</p>
  <p>I was wondering if there was an explanation. Am I missing some input or passing the data wrong?</p>
  <p>The following is the attempted code</p>
  <pre><code>const response = await fetch(
  
                  &quot;https://api-inference.huggingface.co/models/facebook/bart-large-cnn&quot;,
  
                  {
  
                      headers: { Authorization: `Bearer ${API_TOKEN}` },
  
                      method: &quot;POST&quot;,
  
                      data: {
  
                          &quot;inputs&quot;: JSON.stringify(script),
  
                          &quot;parameters&quot;: {&quot;do_sample&quot;: false},
  
                      },
  
                  }
  
              );
  
              const result = await response.json();
  
              setSummation(JSON.stringify(result[0].summary_text))
  </code></pre>