llama dfdx
1.0.0
該倉庫包含流行的Llama 7b語言模型,該模型完全實現了Rust編程語言!
使用DFDX張量和CUDA加速度。
這直接在F16中運行Llama,這意味著CPU上沒有硬件加速度。強烈建議使用CUDA。
這是在A10 GPU上運行的7B型號:

sudo apt install git-lfsgit lfs install 。git clone https://huggingface.co/decapoda-research/llama-7b-hfgit clone https://huggingface.co/decapoda-research/llama-13b-hfgit clone https://huggingface.co/decapoda-research/llama-65b-hfpython3.x -m venv <my_env_name>創建一個python虛擬環境,其中x是您喜歡的python版本source <my_env_name>binactivate (或<my_env_name>Scriptsactivate在Windows上)以激活環境pip install numpy torchpython convert.py以將模型權重轉換為Rust可理解的格式: Llama 7b: python convert.py b。 Llama 13b: python convert.py llama-13b-hf c。 Llama 65B: python convert.py llama-65b-hf 您可以使用普通的生鏽命令進行編譯:
與Cuda:
cargo build --release -F cuda沒有cuda:
cargo build --release使用默認的args:
./target/release/llama-dfdx --model < model-dir > generate " <prompt> "
./target/release/llama-dfdx --model < model-dir > chat
./target/release/llama-dfdx --model < model-dir > file < path to prompt file >要查看可以使用哪些命令/自定義ARG:
./target/release/llama-dfdx --help