Downloads · 30 days
30
17% of all-time downloads
kevinbazira/aya-expanse-8b-gptq-4bit
aya-expanse-8b-gptq-4bit is a text generation model from kevinbazira. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as cc-by-nc-4.0.
This repository contains a quantized version of the CohereForAI/aya-expanse-8b model using the GPTQ method in 4-bit precision.
Downloads · 30 days
30
17% of all-time downloads
All-time downloads
180
Public
Parameters
8B
11.5 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors5.7 GB · 100%
How the weights are stored.
I327B · 87%
From the Hugging Face model README
This repository contains a quantized version of the CohereForAI/aya-expanse-8b model using the GPTQ method in 4-bit precision.
Before using the quantized model, please ensure your environment has:
Load and use the quantized model as shown below in Python:
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
# Set up device
device = torch.device('cuda:1') # Remember to use the correct device here
# Load model and tokenizer
model_name = "kevinbazira/aya-expanse-8b-gptq-4bit"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
device_map={"": device.index}
)
# Prepare input
# https://huggingface.co/docs/transformers/en/pad_truncation
input_text = "Add your prompt here."
inputs = tokenizer(input_text, return_tensors="pt", truncation=True, padding="max_length", max_length=64)
inputs = {key: value.to(device) for key, value in inputs.items()}
# Perform text generation
# https://huggingface.co/docs/transformers/en/main_classes/text_generation
outputs = model.generate(
**inputs,
num_return_sequences=1,
min_new_tokens=64,
max_new_tokens=64,
do_sample=False,
use_cache=True,
num_beams=1
)
# Decode and print the output
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
To evaluate the performance of the quantized model, we run benchmarks using the Hugging Face Optimum Benchmark tool on an AMD MI210 GPU with ROCm 6.1 and below are the results:
These results show that the GPTQ quantized model offers significant speed advantages during critical inference stages (decode and per-token), outweighing the higher latencies encountered during the load and prefill phases. For deployment scenarios where inference speed is paramount, you can preload the quantized model to eliminate initial latency concerns.
[email protected]. I'll be happy to help!