srush/llama2.rs là một trong những repo mã nguồn mở mà TopGit theo dõi, hiện có 1.1k sao, viết chủ yếu bằng Rust. A fast llama2 decoder in pure Rust.
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
The library needs to be recompiled to match the model. You can do this with cargo.
To run:
> cargo run --release --features 70B,group_64,quantized -- -c llama2-70b-q.bin -t 0.0 -s 11 -p "The only thing"
The only thing that I can think of is that the
achieved tok/s: 0.89155835
Honestly, not so bad for running on my GPU machine, significantly faster than llama.c.
Here's a run of 13B quantized:
> cargo run --release --features 13B,group_128,quantized -- -c l13orca.act.bin -t 0.0 -s 25 -p "Hello to all the cool people out there who "
Hello to all the cool people out there who are reading this. I hope you are having a great day. I am here
achieved tok/s: 5.1588936
Here's a run of 7B quantized:
cargo run --release --features 7B,group_128,quantized -- -c l7.ack.bin -t 0.0 -s 25 -p "Hello to all the cool people out there who "
> Hello to all the cool people out there who are reading this. I am a newbie here and I am looking for some
achieved tok/s: 9.048136
Python
To run in Python, you need to first compile from the main directory with the python flag.
import llama2_rs
def test_llama2_13b_4_128act_can_generate():
model = llama2_rs.LlamaModel("lorca13b.act132.bin", False)
tokenizer = llama2_rs.Tokenizer("tokenizer.bin")
random = llama2_rs.Random()
response = llama2_rs.generate(
model,
tokenizer,
"Tell me zero-cost abstractions in Rust ",
50,
random,
0.0
)
Todos
Support fast GPU processing with Triton
Support https://github.com/oobabooga/text-generation-webui
Documentation
Blog Post about the methods for fast gptq
Remove dependency on AutoGPTQ for preloading
Support for safetensors directly.
Configuration
In order to make the model as fast as possible, you need to compile a new version to adapt to other Llama versions. Currently in .cargo/config. The model will fail if these disagree with the binary model that is being loaded. To turn quantization off set it to quant="no".
See Also
Originally, a Rust port of Karpathy's llama2.c but now has a bunch more features to make it scale to 70B.
Also check out:
llama2.rs from @gaxler
llama2.rs from @leo-du
candle and candle llama from @LaurentMazare
How does it work?
Started as a port of the original code, with extra type information to make it easier to extend.
srush/llama2.rs có 1.1k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/srush/llama2.rs. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
srush/llama2.rs có tag gì không?
Bản đồng bộ chưa ghi nhận topic GitHub nào cho srush/llama2.rs. GitHub topics hiển thị ở thanh bên phải trang repo — đó là nơi đáng kiểm tra nhất.
srush/llama2.rs còn đang phát triển không?
Commit gần nhất trên srush/llama2.rs là 2.7 năm trước (theo timestamp GitHub). Repo có 56 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
srush/llama2.rs là gì?
srush/llama2.rs (srush/llama2.rs) là dự án Rust trên GitHub. Theo mô tả gốc: A fast llama2 decoder in pure Rust.
srush/llama2.rs viết bằng ngôn ngữ gì?
srush/llama2.rs chủ yếu viết bằng Rust. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc đầy đủ README ở tab phía trên.
Chưa chắc llama2.rs có hợp với bạn?
Để ChatGPT, Claude hoặc Perplexity tìm hiểu giúp — bấm bên dưới và xem AI nói gì về llama2.rs.