Update README.md
Browse files
README.md
CHANGED
|
@@ -19,16 +19,15 @@ import { pipeline, env } from '@xenova/transformers';
|
|
| 19 |
const generative_model = await pipeline('text2text-generation', 'teapotai/instruct-teapot');
|
| 20 |
|
| 21 |
// Example context from an article (similar to SQuAD)
|
| 22 |
-
const context =
|
| 23 |
The Amazon Rainforest, also known as Amazonia, is a large tropical rainforest occupying the drainage basin of the Amazon River
|
| 24 |
and its tributaries in northern South America, and covering an area of 6,000,000 square kilometers (2,300,000 sq mi).
|
| 25 |
Comprising about 40% of Brazil's total area, it is bordered by the Guiana Highlands to the north, the Andes Mountains to the west,
|
| 26 |
the Brazilian Central Plateau to the south, and the Atlantic Ocean to the east.
|
| 27 |
-
|
| 28 |
|
| 29 |
const query = "What percentage of Brazil's total area does the Amazon Rainforest cover?";
|
| 30 |
-
const result = await generative_model(
|
| 31 |
-
\${query}\`);
|
| 32 |
|
| 33 |
console.log(result); // 40%
|
| 34 |
```
|
|
|
|
| 19 |
const generative_model = await pipeline('text2text-generation', 'teapotai/instruct-teapot');
|
| 20 |
|
| 21 |
// Example context from an article (similar to SQuAD)
|
| 22 |
+
const context = `
|
| 23 |
The Amazon Rainforest, also known as Amazonia, is a large tropical rainforest occupying the drainage basin of the Amazon River
|
| 24 |
and its tributaries in northern South America, and covering an area of 6,000,000 square kilometers (2,300,000 sq mi).
|
| 25 |
Comprising about 40% of Brazil's total area, it is bordered by the Guiana Highlands to the north, the Andes Mountains to the west,
|
| 26 |
the Brazilian Central Plateau to the south, and the Atlantic Ocean to the east.
|
| 27 |
+
`;
|
| 28 |
|
| 29 |
const query = "What percentage of Brazil's total area does the Amazon Rainforest cover?";
|
| 30 |
+
const result = await generative_model(context+query);
|
|
|
|
| 31 |
|
| 32 |
console.log(result); // 40%
|
| 33 |
```
|