AI术语词典

A comprehensive multilingual AI terminology dictionary

Definition

Unsloth 是一款专为优化大语言模型(LLM)的微调和部署而设计的工具。它通过替换标准的 PyTorch 操作,实现了显著的速度提升和内存占用减少。

Summary

Unsloth 是一个开源库,通过优化的内存管理和内核实现,将大语言模型(LLM)的训练和推理速度提升高达 2 倍。

Key Concepts

Use Cases

Code Example

1
2
3
4
5
6
7
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained(
    model_name="unsloth/Llama-2-7b-bnb-4bit",
    max_seq_length=2048,
    dtype=None,
    load_in_4bit=True
)