Instructions to use samgreen/internlm2-chat-20b-nf4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use samgreen/internlm2-chat-20b-nf4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="samgreen/internlm2-chat-20b-nf4", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("samgreen/internlm2-chat-20b-nf4", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
InterLM2-Chat NF4 Quant
Usage
As of 2024/1/17, Transformers must be installed from source and bitsandbytes >=0.42.0 is required in order to load serialized 4-bit quants.
pip install -U git+https://github.com/huggingface/transformers bitsandbytes
Quantization config
quantization_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_use_double_quant=True,
bnb_4bit_compute_dtype=torch.bfloat16,
)
Not necessary for inference, just load the model without specifying any quantization/load_in_*bit.
Model Details
- Downloads last month
- 7