Downloads · 30 days
9
14% of all-time downloads
itsankitkp/Qwen2-0.5B-Instruct-awq
Qwen2-0.5B-Instruct-awq is a text generation model from itsankitkp. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
Downloads · 30 days
9
14% of all-time downloads
All-time downloads
65
Public
Parameters
630M
731 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors731 MB · 98%
How the weights are stored.
I32358M · 57%
From the Hugging Face model README
Quantized version of Qwen/Qwen2-0.5B-Instruct
Inference
from awq import AutoAWQForCausalLM
from transformers import AutoTokenizer, TextStreamer
quant_path = "itsankitkp/Qwen2-0.5B-Instruct-awq"
# Load model
model = AutoAWQForCausalLM.from_quantized(quant_path, fuse_layers=True)
tokenizer = AutoTokenizer.from_pretrained(quant_path, trust_remote_code=True)
streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
# Convert prompt to tokens
prompt_template = """\
<|system|>
</s>
<|user|>
{prompt}</s>
<|assistant|>"""
prompt = "You're standing on the surface of the Earth. "\
"You walk one mile south, one mile west and one mile north. "\
"You end up exactly where you started. Where are you?"
tokens = tokenizer(
prompt_template.format(prompt=prompt),
return_tensors='pt'
).input_ids.cuda()
# Generate output
generation_output = model.generate(
tokens,
streamer=streamer,
max_seq_len=512
)