Tủ GitHub repo xịn
Avatar lyogavin

GitHub repo xịn · Vui Coding chọn

lyogavin/airllm

AirLLM giúp giảm tiêu thụ bộ nhớ inference của các mô hình ngôn ngữ lớn, cho phép chạy mô hình 70B trên GPU 4GB mà không cần quantization, distillation hay pruning. Nó hỗ trợ nhiều mô hình mở rộng lớn, phù hợp với môi trường hạn chế VRAM.

33,2 NGitHub stars
3,5 NForks
146Open issues
0Lượt nhấp GitHub
Jupyter NotebookNgôn ngữ chính

Tóm tắt nhanh

Repo này làm được gì?

AirLLM giúp giảm tiêu thụ bộ nhớ inference của các mô hình ngôn ngữ lớn, cho phép chạy mô hình 70B trên GPU 4GB mà không cần quantization, distillation hay pruning. Nó hỗ trợ nhiều mô hình mở rộng lớn, phù hợp với môi trường hạn chế VRAM.

Mô tả từ GitHub

AirLLM 70B inference with single 4GB GPU

Bắt đầu với repo

Cài đặt và sử dụng

Hướng dẫn cài đặt

1. Cài đặt package airllm:

pip install airllm

Hướng dẫn sử dụng

1. Khởi tạo mô hình:

from airllm import AutoModel
model = AutoModel.from_pretrained("Qwen/Qwen3-32B")

2. Chuẩn bị đầu vào:

input_text = ['What is the capital of United States?']
input_tokens = model.tokenizer(input_text, return_tensors="pt", max_length=128, padding=False, truncation=True)

3. Sinh dữ liệu:

generation_output = model.generate(input_tokens['input_ids'].cuda(), max_new_tokens=20, use_cache=True, return_dict_in_generate=True)
output = model.tokenizer.decode(generation_output.sequences[0])
print(output)
Đối chiếu README gốc

Chủ đề liên quan

#chinese-llm#chinese-nlp#finetune#generative-ai#instruct-gpt#instruction-set#llama#llm#lora#open-models#open-source#open-source-models
Mở trên GitHub

Cùng hệ sinh thái

Repo liên quan