ONNX version of teapotai/teapotllm to use with Transformers.js.
Also includes a JavaScript version of the teapotai python package for interacting with the model using the Transformers.js library.
View the example script index.js.
Check the WebGPU ONNX Playground.
yarn install
This library provides a TeapotAI class that helps you interact with language models. Here's a basic example:
import TeapotAI from './TeapotAI.js';
const ai = new TeapotAI({
pipelineOptions: {
dtype: 'q4'
}
});
// Query with context
const response = await ai.query(
"What is the capital?",
"France is a country in Western Europe."
);
有文件?提交种子。
发布种子onnx/decoder_model_merged.onnx 1.8 GiBonnx/decoder_model.onnx 1.8 GiBonnx/decoder_with_past_model.onnx 1.6 GiBonnx/encoder_model.onnx 1.3 GiBonnx/decoder_model_merged_fp16.onnx 907 MiBonnx/decoder_model_fp16.onnx 906 MiBonnx/decoder_with_past_model_fp16.onnx 810 MiBonnx/encoder_model_fp16.onnx 651 MiBonnx/decoder_model_merged_int8.onnx 457 MiBonnx/decoder_model_merged_quantized.onnx 457 MiBonnx/decoder_model_merged_uint8.onnx 457 MiBonnx/decoder_model_int8.onnx 456 MiBonnx/decoder_model_quantized.onnx 456 MiBonnx/decoder_model_uint8.onnx 456 MiBonnx/decoder_with_past_model_int8.onnx 407 MiBonnx/decoder_with_past_model_quantized.onnx 407 MiBonnx/decoder_with_past_model_uint8.onnx 407 MiBonnx/decoder_model_merged_q4.onnx 391 MiBonnx/decoder_model_q4.onnx 390 MiBonnx/decoder_model_merged_bnb4.onnx 364 MiBonnx/decoder_model_bnb4.onnx 363 MiBonnx/decoder_with_past_model_q4.onnx 360 MiBonnx/decoder_with_past_model_bnb4.onnx 336 MiBonnx/encoder_model_int8.onnx 327 MiBonnx/encoder_model_quantized.onnx 327 MiBonnx/encoder_model_uint8.onnx 327 MiBonnx/encoder_model_q4.onnx 310 MiBonnx/decoder_model_merged_q4f16.onnx 301 MiBonnx/decoder_model_q4f16.onnx 301 MiBonnx/encoder_model_bnb4.onnx 291 MiBonnx/decoder_with_past_model_q4f16.onnx 273 MiBonnx/encoder_model_q4f16.onnx 229 MiB