trrahul / llama2.cs

Inference Llama 2 in one file of pure C#
MIT License
90 stars 13 forks source link

Overflow on int variable #1

Closed theolivenbaum closed 10 months ago

theolivenbaum commented 10 months ago

Just testing the code on llama2-7b, and this line overflows when reading: https://github.com/trrahul/llama2.cs/blob/89643a6f0b026f61034f8a6934b146404a7e0c20/Program.cs#L590

it should have been instead:

offset += sizeof(float) * (long)size;