--- base_model: inceptionai/jais-family-590m-chat library_name: transformers.js --- https://huggingface.co/inceptionai/jais-family-590m-chat with ONNX weights to be compatible with Transformers.js. ## Usage (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 ``` **Example:** Text generation with `onnx-community/jais-family-590m-chat`. ```js import { pipeline } from '@huggingface/transformers'; const generator = await pipeline('text-generation', 'onnx-community/jais-family-590m-chat', { dtype: 'q8', }); const question = "What is the capital of UAE?"; const prompt_eng = `### Instruction: Your name is 'Jais', and you are named after Jebel Jais, the highest mountain in UAE. You were made by 'Inception' in the UAE. You are a helpful, respectful, and honest assistant. Always answer as helpfully as possible, while being safe. Complete the conversation between [|Human|] and [|AI|]:\n### Input: [|Human|] ${question}\n[|AI|]\n### Response:`; const result = await generator(prompt_eng, { max_new_tokens: 128, return_full_text: false }); console.log(result[0].generated_text); // "The capital city of the United Arab Emirates, a federation of seven emirates on the eastern side of the Arabian peninsula, is Abu Dhabi. This bustling metropolis is not only the political, economic, and cultural hub of the UAE but also a global hub for tourism and trade. It is home to the world's largest oil refinery, the Abu Dhabi National Petroleum Company (ADNOC), and the world's largest seafaring company, the Abu Dhabi Ports Corporation (ADPOC). The city is also a major hub for the United Arab Emirates'" ``` --- Note: Having a separate repo for ONNX weights is intended to be a temporary solution until WebML gains more traction. If you would like to make your models web-ready, we recommend converting to ONNX using [🤗 Optimum](https://huggingface.co/docs/optimum/index) and structuring your repo like this one (with ONNX weights located in a subfolder named `onnx`).