kshitijthakkar/qwen3.5-0.8b-moe-from-scratch
013
qwen3.5-0.8b-moe-from-scratch
Built from scratch following Sebastian Raschka's LLMs-from-Scratch style, then weights transferred from kshitijthakkar/qwen3.5-moe-0.87B-d0.8B.
Architecture
Usage
from transformers import AutoModelForImageTextToText, AutoProcessor
model = AutoModelForImageTextToText.from_pretrained(
"kshitijthakkar/qwen3.5-0.8b-moe-from-scratch",
torch_dtype="bfloat16",
device_map="auto",
)
processor = AutoProcessor.from_pretrained("kshitijthakkar/qwen3.5-0.8b-moe-from-scratch")
messages = [{"role": "user", "content": "Explain the Qwen3.5 architecture."}]
inputs = processor.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=200)
print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))How it was built
See the companion notebook `qwen3_5_from_scratch.ipynb` for the full from-scratch implementation.
