Imports

import torch
from hqq.engine.hf import HQQModelForCausalLM, AutoTokenizer
from hqq.utils.patching import prepare_for_inference

Loading Weights

model = HQQModelForCausalLM.from_quantized("rohitg/Mixtral-8x22B-Instruct-v0.1-hf-4bit_g64-HQQ", device='cuda')
tokenizer = AutoTokenizer.from_pretrained('mistralai/Mixtral-8x22B-Instruct-v0.1')
prepare_for_inference(model, backend="torchao_int4")

Text Generation

prompt = "<s> [INST] How do I build a car? [/INST] "

inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False)
outputs = model.generate(**(inputs.to('cuda')), max_new_tokens=1000)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model is not currently available via any of the supported Inference Providers.
The model cannot be deployed to the HF Inference API: The model has no library tag.