Views
No views yet
teapot-instruct model is fine-tuned for optimized web-based Retrieval-Augmented Generation (RAG) question answering. Designed for browser environments, it efficiently retrieves, synthesizes, and answers queries based on web content.1import { pipeline, env } from '@xenova/transformers';
2
3const generative_model = await pipeline('text2text-generation', 'teapotai/instruct-teapot');
4
5// Example context from an article (similar to SQuAD)
6const context = `
7 The Amazon Rainforest, also known as Amazonia, is a large tropical rainforest occupying the drainage basin of the Amazon River
8 and its tributaries in northern South America, and covering an area of 6,000,000 square kilometers (2,300,000 sq mi).
9 Comprising about 40% of Brazil's total area, it is bordered by the Guiana Highlands to the north, the Andes Mountains to the west,
10 the Brazilian Central Plateau to the south, and the Atlantic Ocean to the east.
11`;
12
13const query = "What percentage of Brazil's total area does the Amazon Rainforest cover?";
14const result = await generative_model(context+query);
15
16console.log(result); // 40%