ailia-models icon indicating copy to clipboard operation
ailia-models copied to clipboard

ADD Elyza 7b

Open kyakuno opened this issue 1 year ago • 9 comments

External pbでエクスポートする。 https://huggingface.co/elyza/ELYZA-japanese-Llama-2-7b

kyakuno avatar Oct 29 '23 10:10 kyakuno

Elyzaについて https://note.com/elyza/n/na405acaca130

kyakuno avatar Oct 29 '23 10:10 kyakuno

Llama2のONNX変換 https://github.com/microsoft/Llama-2-Onnx

kyakuno avatar Oct 29 '23 10:10 kyakuno

Elyzaをllama-2-onnxで変換して推論するサンプルを作る。

kyakuno avatar Oct 29 '23 10:10 kyakuno

FP16でエクスポートする。7bで14GBになるはず。

kyakuno avatar Oct 29 '23 10:10 kyakuno

Llama2 ONNX conversion https://github.com/microsoft/Llama-2-Onnx

@kyakuno san do you have access? I applied yesterday, but I still have not received access. Following says that access is provided within the next 48 hours

The sub-modules that contain the ONNX files in this repository are access controlled. To get access permissions to the Llama 2 model, please fill out the Llama 2 ONNX sign up page. If allowable, you will receive GitHub access in the next 48 hours, but usually much sooner.

YToleubay avatar Oct 31 '23 01:10 YToleubay

This is command: クマが海辺に行ってアザラシと友達になり、最終的には家に帰るというプロットの短編小説を書いてください This is output of the pytorch model with torch.float16 precision:

_クマは、毎日のように海辺に行っていた。
そこでは、アザラシが泳いでいた。
クマは、アザラシと友達になりたいと思っていた。
そして、その日がやってきた。
クマは、アザラシに話しかけた。
「アザラシ、お前はどこから来たのだ?」
「私は、ここから来ました。」
「そうか。
それで、どうしてここにいるのだ?」
「私は、ここにいるのです。」
「そうか。
それで、お前は、どうして私と友達になりたいと思ったのだ?」
「私は、私の家に帰りたいのです。」
「そうか。
それで、お前は、どうして_

This is output of the onnx model:

クマは、毎日のように海辺に行っていた。
そこでは、アザラシが泳いでいた。
クマは、アザラシと友達になりたいと思っていた。
そして、その日がやってきた。
クマは、アザラシに話しかけた。
「アザラシ、お前はどこから来たのだ?」
「私は、ここから来ました。」
「そうか。
それで、どうしてここにいるのだ?」
「私は、ここにいるのです。」
「そうか。
それで、お前は、どうして私と友達になりたいと思ったのだ?」
「私は、私の家に帰りたいのです。」
「そうか。
それで、お前は、どうして

YToleubay avatar Nov 13 '23 09:11 YToleubay

@YToleubay It's very good result. Please create sample script and please give me PR.

kyakuno avatar Nov 13 '23 09:11 kyakuno

@YToleubay It's very good result. Please create sample script and please give me PR.

@kyakuno when I am trying to run it with ailia model shows error : ailia.core.Ailia UnimplementedException: code: -15 (This function is not implemented.) + error detail : Tensors with data location set to other than DEFAULT is not supported.

I think problem is related to onnx_data file. It is around 9GB. Should I partition the model?

YToleubay avatar Nov 13 '23 10:11 YToleubay

ailia SDK 1.2.16 will supports external pb. So please use internal release of 1.2.16. I will share you via slack.

kyakuno avatar Nov 13 '23 10:11 kyakuno