Instructions to use onnx-community/jais-family-590m-chat with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use onnx-community/jais-family-590m-chat with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('text-generation', 'onnx-community/jais-family-590m-chat');
Download tokenizer_config.json from onnx-community/jais-family-590m-chat: direct link, hf CLI and curl.
- Browser
- Download file 1.85 kB
-
https://huggingface.co/onnx-community/jais-family-590m-chat/resolve/main/tokenizer_config.json
- Command line
-
hf download hf://onnx-community/jais-family-590m-chat/tokenizer_config.json
-
curl -L -o tokenizer_config.json https://huggingface.co/onnx-community/jais-family-590m-chat/resolve/main/tokenizer_config.json
1.85 kB
| { | |
| "added_tokens_decoder": { | |
| "0": { | |
| "content": "<|endoftext|>", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| } | |
| }, | |
| "bos_token": "<|endoftext|>", | |
| "chat_template": "{% if messages[0]['role'] == 'system' %}{% set loop_messages = messages[1:] %}{% set system_message = '### Instruction: ' + messages[0]['content'] + '\nComplete the conversation below between [|Human|] and [|AI|]:\n### Input:'%}{% else %}{% set loop_messages = messages %}{% set system_message = '### 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 below between [|Human|] and [|AI|]:\n### Input:' %}{% endif %}{% for message in loop_messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if loop.index0 == 0 and system_message != false %}{% set content = system_message %}{% else %}{% set content = message['content'] %}{% endif %}{% if message['role'] == 'user' %}{% if loop.index0 == 0 %}{{ content + ' [|Human|] ' + message['content'] }}{% else %}{{ '\n[|Human|] ' + content.strip() }}{% endif %}{% elif message['role'] == 'assistant' %}{{ '\n[|AI|] ' + content.strip() }}{% endif %}{% endfor %}{% if add_generation_prompt and messages[-1]['role'] != 'assistant' %} {{'\n[|AI|]\n### Response:'}}{% endif %}", | |
| "clean_up_tokenization_spaces": true, | |
| "eos_token": "<|endoftext|>", | |
| "model_max_length": 2048, | |
| "pad_token": "<|endoftext|>", | |
| "tokenizer_class": "PreTrainedTokenizerFast", | |
| "unk_token": "<|endoftext|>" | |
| } | |