Downloads · 30 days
177
0% of all-time downloads
ModelCloud/gemma-2-27b-it-gptq-4bit
gemma-2-27b-it-gptq-4bit is a text generation model from ModelCloud. Use it when you need the model to write or continue text. It is set up for transformers.
This model has been quantized using GPTQModel.
Downloads · 30 days
177
0% of all-time downloads
All-time downloads
51.8K
Public
Parameters
28.4B
18.3 GB on disk
Likes
12
Public
Click a slice to open those files.
.safetensors18.3 GB · 100%
How the weights are stored.
I3226B · 92%
From the Hugging Face model README
This model has been quantized using GPTQModel.
Currently, only vllm can load the quantized gemma2-27b for proper inference. Here is an example:
import os
# Gemma-2 use Flashinfer backend for models with logits_soft_cap. Otherwise, the output might be wrong.
os.environ['VLLM_ATTENTION_BACKEND'] = 'FLASHINFER'
from transformers import AutoTokenizer
from gptqmodel import BACKEND, GPTQModel
model_name = "ModelCloud/gemma-2-27b-it-gptq-4bit"
prompt = [{"role": "user", "content": "I am in Shanghai, preparing to visit the natural history museum. Can you tell me the best way to"}]
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = GPTQModel.from_quantized(
model_name,
backend=BACKEND.VLLM,
)
inputs = tokenizer.apply_chat_template(prompt, tokenize=False, add_generation_prompt=True)
outputs = model.generate(prompts=inputs, temperature=0.95, max_length=128)
print(outputs[0].outputs[0].text)