Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/likejazz/llama3.np
llama3.np is a pure NumPy implementation for Llama 3 model.
https://github.com/likejazz/llama3.np
Last synced: 7 days ago
JSON representation
llama3.np is a pure NumPy implementation for Llama 3 model.
- Host: GitHub
- URL: https://github.com/likejazz/llama3.np
- Owner: likejazz
- License: mit
- Created: 2024-05-13T09:16:30.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-06-02T23:26:22.000Z (5 months ago)
- Last Synced: 2024-10-01T19:10:54.275Z (about 1 month ago)
- Language: Python
- Homepage:
- Size: 83.7 MB
- Stars: 959
- Watchers: 13
- Forks: 73
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- AiTreasureBox - likejazz/llama3.np - 11-02_970_0](https://img.shields.io/github/stars/likejazz/llama3.np.svg)|llama3.np is pure NumPy implementation for Llama 3 model.| (Repos)
README
# llama3.np
`llama3.np` is a pure NumPy implementation for Llama 3 model. For an accurate implementation, I ran the [stories15M model](https://github.com/karpathy/llama2.c?tab=readme-ov-file#models) trained by Andrej Karpathy.
- For a detailed explanation in English, see [Llama 3 implemented in pure NumPy](https://docs.likejazz.com/llama3.np/).
- If you're interested in CUDA implementation, see [Llama 3 implemented in pure C/CUDA](https://github.com/likejazz/llama3.cuda).## Usage
```shell
$ python llama3.py "I have a dream"
"""
I have a dream. He dream of a big, beautiful garden full of flower and tree. He dream of playing with hi friend and eating yummy snack.
One day, he wa walking in the garden when he sawToken count: 50, elapsed: 1.53s, 33 tokens/s
"""
```## Citing llama3.np
If you use or discuss `llama3.np` in your academic research, please cite the project to help spread awareness:
```
@misc{llama3.np,
title = {llama3.np: pure NumPy implementation for Llama 3 model},
author = {Sang Park},
howpublished = {\url{https://github.com/likejazz/llama3.np}},
note = {llama3.np, MIT License}
year = {2024},
}
```# References
Thank you to the creators of the following libraries and tools and their contributors:
- [llama2.c](https://github.com/karpathy/llama2.c) - @karpathy
- [llama.np](https://github.com/hscspring/llama.np) - @hscspring
- [modeling_llama.py](https://github.com/huggingface/transformers/blob/main/src/transformers/models/llama/modeling_llama.py) - Hugging Face's TransformersI got a lot of information from the articles below:
- [42dot LLM 1.3B](https://42dot.ai/blog/178) - 42dot
- [Exploring and building the LLaMA 3 Architecture : A Deep Dive into Components, Coding, and Inference Techniques](https://medium.com/@vi.ai_/exploring-and-building-the-llama-3-architecture-a-deep-dive-into-components-coding-and-43d4097cfbbb) - @vi.ai_
- [Rotary Embeddings: A Relative Revolution](https://blog.eleuther.ai/rotary-embeddings/) - EleutherAI
- [Mastering LLM Techniques: Inference Optimization](https://developer.nvidia.com/blog/mastering-llm-techniques-inference-optimization/) - NVIDIAAnd title image was generated by DALL-E
# License
MIT