-
Notifications
You must be signed in to change notification settings - Fork 868
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unsupported model type: jais #906
Comments
The model you've linked to appears to be gated, so I added support for and tested w/ https://huggingface.co/onnx-community/tiny-random-jais. Once you convert your one to ONNX, it should work with Transformers.js v3 👍 |
@xenova Thanks for your support, I've granted you the access to the model, can you convert it to onnx or tell me how, because I tried the below code snippet but returned this error, so I wonder how did you prepared the "tiny-random-jais" model: Error:
The code snippet:
|
You can do it with our conversion script: git clone -b v3 https://github.com/xenova/transformers.js.git
cd transformers.js
pip install -q -r scripts/requirements.txt
python -m scripts.convert \
--quantize \
--model_id katuni4ka/tiny-random-jais \
--trust_remote_code \
--skip_validation \
--custom_onnx_configs '{"model":"gpt2"}' \
--task text-generation-with-past I can make PRs for your models, if you'd like 👍 |
That is clear, thanks a lot, yes please PR would be great |
PR made 👍 I've also added fp16 and int8 quantized variants, which may help reduce computational load. I haven't been able to test them though... hopefully it works! 🤞 I have tested https://huggingface.co/inceptionai/jais-family-590m-chat, and that seems to work fine 👍 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); produces:
|
@xenova The original error is now gone put a new error was raised
Any idea what is missing? |
Yes we are still adding the external data functionality (to load models > 2GB). For now, you can set |
@xenova Thanks for your support, it seems to be working fine now. |
@xenova Thanks again for your effort, lastly, can you please share with me the snippet used to produce this PR, in order to use it in our future models |
Question
System Info
macOS, node v20.10, @xenova/transformers 2.17.2
Environment/Platform
Description
Reproduction
The text was updated successfully, but these errors were encountered: