Newq-0.5B-Instruct

Newq is a compact 0.5B-parameter instruction-tuned language model for chat and general text generation. It is small enough to run comfortably on CPU or a modest GPU, and supports long contexts.

Details

  • Parameters: 0.49B (0.36B non-embedding)
  • Layers: 24
  • Attention heads: 14 for Q, 2 for KV (GQA)
  • Context length: 32,768 tokens
  • Precision: bfloat16

Usage

from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "mayank64ce/Newq-0.5B-Instruct"
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype="auto", device_map="auto")
tokenizer = AutoTokenizer.from_pretrained(model_name)

messages = [{"role": "user", "content": "Give me a short introduction to large language models."}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer([text], return_tensors="pt").to(model.device)

out = model.generate(**inputs, max_new_tokens=512)
out = out[0][len(inputs.input_ids[0]):]
print(tokenizer.decode(out, skip_special_tokens=True))

License and attribution

Released under the Apache License 2.0.

This model is a derivative of Qwen/Qwen2.5-0.5B-Instruct by the Qwen team, Alibaba Cloud, used under Apache-2.0. The original license text is included in this repository.

Downloads last month
367
Safetensors
Model size
0.5B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for mayank64ce/Newq-0.5B-Instruct

Finetuned
(1003)
this model