How to use from the
Use from the
Transformers library
# Use a pipeline as a high-level helper
from transformers import pipeline

pipe = pipeline("text-generation", model="Compumacy/Meta-Llama-3-8B-Instruct-WINT8")
messages = [
    {"role": "user", "content": "Who are you?"},
]
pipe(messages)
# pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM

tokenizer = AutoTokenizer.from_pretrained("Compumacy/Meta-Llama-3-8B-Instruct-WINT8")
model = AutoModelForCausalLM.from_pretrained("Compumacy/Meta-Llama-3-8B-Instruct-WINT8", device_map="auto")
messages = [
    {"role": "user", "content": "Who are you?"},
]
inputs = tokenizer.apply_chat_template(
	messages,
	add_generation_prompt=True,
	tokenize=True,
	return_dict=True,
	return_tensors="pt",
).to(model.device)

outputs = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))
Quick Links

Meta-Llama-3-8B-Instruct-WINT8

This model is a 8-bit quantized version of meta-llama/Meta-Llama-3-8B-Instruct "using the llmcompressor library.

Quantization Details

quant_stage:
      quant_modifiers:
        QuantizationModifier:
          ignore: [lm_head]
          config_groups:
            group_0:
              weights: {num_bits: 8, type: int, symmetric: true, strategy: channel, dynamic: false}
              targets: [Linear]

Evaluation Results

The following table shows the evaluation results on various benchmarks compared to the baseline (non-quantized) model.

Task Baseline Metric (10.0% Threshold) Quantized Metric Metric Type
winogrande 0.7577 0.7616 acc,none

How to Use

You can load the quantized model and tokenizer using the transformers library:

from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "NoorNizar/Meta-Llama-3-8B-Instruct-WINT8"

model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto")
tokenizer = AutoTokenizer.from_pretrained(model_id)

# Example usage (replace with your specific task)
prompt = "Hello, world!"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=50)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

Disclaimer

This model was quantized automatically using a script. Performance and behavior might differ slightly from the original base model.

Downloads last month
11
Safetensors
Model size
8B params
Tensor type
F16
ยท
I8
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support