Skip to content

build llama inference compute from scrath, only using torch/numpy base ops

Notifications You must be signed in to change notification settings

ckfgihub/naked_llama

This branch is 1 commit ahead of, 117 commits behind silencelamb/naked_llama:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

e719e54 · Apr 11, 2024

History

27 Commits
Mar 27, 2024
Apr 11, 2024
Apr 11, 2024
Apr 11, 2024
Mar 28, 2024
Mar 27, 2024
Mar 27, 2024
Mar 28, 2024
Mar 27, 2024
Mar 27, 2024
Apr 7, 2024
Mar 27, 2024

Repository files navigation

Naked LLaMA

Build llama inference compute from scrath, only using torch/numpy base ops

Inspired by karpathy's awesome repo nanoGPT, I re-implemented a simple and clear llama model from scratch.

install

pip install torch >= 2.1.0

# transformers is used for convert model weights and compare results
pip install transformers >= 4.35.2

excute & result

git clone https://github.com/silencelamb/naked_llama.git

# convert huggingface model to npy file
python convert_hf_to_pkl.py  # default model_size is 7b

# default model_size is 7b
python naked_llama.py

# run 70 b
python naked_llama.py --model_size 70b

references

About

build llama inference compute from scrath, only using torch/numpy base ops

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%