tairov / llama2.mojo

Inference Llama 2 in one file of pure 🔥
https://www.modular.com/blog/community-spotlight-how-i-built-llama2-by-aydyn-tairov
MIT License
2.09k stars 139 forks source link

Update Mojo to v0.5.0 #74

Closed camegone closed 10 months ago

camegone commented 10 months ago

Fixed error happen on run with Mojo v0.5.0:

$ mojo -v
mojo 0.5.0 (6e50a738)
$ mojo llama2.mojo stories15M.bin -s 100 -n 256 -t 0.5 -i "Mojo is a language"
./llama2.mojo/read/__init__.mojo:99:24: error: 'DTypePointer[ui8]' value has no attribute 'as_scalar_pointer'
            buffer.data.as_scalar_pointer(), sizeof[UInt8](), BUF_SIZE, self.handle
            ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
mojo: error: failed to parse the provided Mojo
tairov commented 10 months ago

Thanks @camegone for taking time to add support for 050. We just had another PR that removes dependency on read module. I merged it just now, so you should be able to run inference safely on 0.5.0