executorch icon indicating copy to clipboard operation
executorch copied to clipboard

Exporting Llama3's tokenizer

Open vifi2021 opened this issue 1 year ago • 6 comments

Hello,

I am following https://github.com/pytorch/executorch/blob/main/examples/models/llama2/README.md#option-c-download-and-export-llama3-8b-model to make Llama3-8B-instruct to run on an S21 Ultra. But seems like the examples.models.llama2.tokenizer.tokenizer cannot process llama3's tokenizer.model.

Has anyone run into this issue?

vifi2021 avatar May 08 '24 23:05 vifi2021

@larryliu0820 , could you help look at this?

iseeyuan avatar May 09 '24 00:05 iseeyuan

Hello you don't need to process tokenizer.model you can just feed it into this step: https://github.com/pytorch/executorch/blob/main/examples/models/llama2/README.md#step-4-run-on-your-computer-to-validate

larryliu0820 avatar May 09 '24 00:05 larryliu0820

Thanks for the fast response. But I am not running it on my computer. I am running it on an Android phone. In https://github.com/pytorch/executorch/blob/main/examples/models/llama2/README.md#step-5-run-benchmark-on-android-phone step 2.2, it requires to upload model, tokenizer to the phone:

adb push <model.pte> /data/local/tmp/llama/
adb push <tokenizer.bin> /data/local/tmp/llama/

Looks like we still need tokenizer.bin?

vifi2021 avatar May 09 '24 01:05 vifi2021

Just do:

adb push <tokenizer.model> /data/local/tmp/llama/

And use <tokenizer.model> wherever you need to specify the tokenizer.

jonatananselmo avatar May 09 '24 02:05 jonatananselmo

@kirklandsign Since theres some android question can u take a look

JacobSzwejbka avatar May 09 '24 20:05 JacobSzwejbka

@vifi2021

In Step 4, we have this "For Llama3, you can pass the original tokenizer.model (without converting to .bin file)."

It also applies to subsequent steps.

@kirklandsign

In our readme file, for Step 5, 2.2 and 2.3, we make that clear.

mergennachin avatar May 10 '24 15:05 mergennachin

We updated our setup and readme recently. Please check out the latest one.

kirklandsign avatar Oct 01 '24 20:10 kirklandsign