-
Notifications
You must be signed in to change notification settings - Fork 87
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
llama2 7b model #89
Comments
hi,
currently the LLM sample application only supports
"TinyLlama-1.1B-Chat-v0.3-fp16" and "Mistral-7B-Instruct-v0.2-fp16".
Vito
|
Hello, So is it not possible to customise another LLM model? Thanks |
Since TinyLlama adopts the same architecture and tokenizer as Llama 2,
adding Llama 2 support to src/llm.cpp should be fairly simple. It involves
exporting the onnx file, running "onnxsim_large_model" on it, and finally
running "onnx2txt".
Vito
|
Hello, I already try but some error comes out plz help me.
after export my model and "onnxsim_large_model" > "onnx2txt"
output of my onnx2txt code how can I fix it? |
I will try to reproduce the problem and let you know in the next few days.
This problem is typically caused by the fact that the implementation of the
HF Transformers has changed compared to the version I used to generate the
TinyLlama onnx file. This causes the new onnx file to be different. A quick
fix could be to use the same version of the HF Transformers to generate the
new onnx file...
I'll let you know ASAP,
Vito
|
I was able to run src/llm.cpp with llama2 exported using your script.
The problem is that your script preserves the upcasts (float16->float32)
and downcasts (float32->float16) needed in certain parts of the model to
preserve the accuracy of the activations.
Please note that src/llm.cpp handles the upcast problem in the code (search
that file for "model.m_requires_upcast").
The solution is, in your script, in the line
"AutoModelForCausalLM.from_pretrained(model_name,
torch_dtype=torch.float16)" replace "float16" with "float32" (or delete
"torch_dtype=torch.float16").
Vito
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
Thank you for your interesting project.
Can I use OnnxStream task in Llama2 -7b fp16 model??
The text was updated successfully, but these errors were encountered: