Instructions to use onnx-community/ettin-decoder-150m-ONNX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use onnx-community/ettin-decoder-150m-ONNX with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('text-generation', 'onnx-community/ettin-decoder-150m-ONNX');
|
Download README.md from onnx-community/ettin-decoder-150m-ONNX: direct link, hf CLI and curl.
- Browser
- Download file 968 Bytes
-
https://huggingface.co/onnx-community/ettin-decoder-150m-ONNX/resolve/main/README.md
- Command line
-
hf download hf://onnx-community/ettin-decoder-150m-ONNX/README.md
-
curl -L -o README.md https://huggingface.co/onnx-community/ettin-decoder-150m-ONNX/resolve/main/README.md
968 Bytes
| license: mit | |
| language: | |
| - en | |
| base_model: | |
| - jhu-clsp/ettin-decoder-150m | |
| pipeline_tag: text-generation | |
| library_name: transformers.js | |
| ### Transformers.js | |
| If you haven't already, you can install the [Transformers.js](https://huggingface.co/docs/transformers.js) JavaScript library from [NPM](https://www.npmjs.com/package/@huggingface/transformers) using: | |
| ```bash | |
| npm i @huggingface/transformers | |
| ``` | |
| You can then generate text as follows: | |
| ```js | |
| import { pipeline, TextStreamer } from "@huggingface/transformers"; | |
| // Create a text generation pipeline | |
| const generator = await pipeline( | |
| "text-generation", | |
| "onnx-community/ettin-decoder-150m-ONNX", | |
| { dtype: "fp32" }, | |
| ); | |
| // Generate a response | |
| const text = "Q: What is the capital of France?\nA:"; | |
| const output = await generator(text, { | |
| max_new_tokens: 128, | |
| streamer: new TextStreamer(generator.tokenizer, { skip_prompt: true, skip_special_tokens: true }), | |
| }); | |
| console.log(output[0].generated_text); | |
| ``` | |