Views
No views yet
npm i @huggingface/transformers1import { pipeline } from '@huggingface/transformers';
2
3const generator = await pipeline('summarization', 'Xenova/distilbart-xsum-9-6');
4const text = 'The tower is 324 metres (1,063 ft) tall, about the same height as an 81-storey building, ' +
5 'and the tallest structure in Paris. Its base is square, measuring 125 metres (410 ft) on each side. ' +
6 'During its construction, the Eiffel Tower surpassed the Washington Monument to become the tallest ' +
7 'man-made structure in the world, a title it held for 41 years until the Chrysler Building in New ' +
8 'York City was finished in 1930. It was the first structure to reach a height of 300 metres. Due to ' +
9 'the addition of a broadcasting aerial at the top of the tower in 1957, it is now taller than the ' +
10 'Chrysler Building by 5.2 metres (17 ft). Excluding transmitters, the Eiffel Tower is the second ' +
11 'tallest free-standing structure in France after the Millau Viaduct.';
12const output = await generator(text, {
13 max_new_tokens: 100,
14});onnx).