Views
No views yet
| Parameter | Original | Tiny |
|---|---|---|
| num_hidden_layers | 32 | 4 |
| num_local_experts | 16 | 8 |
| hidden_size | 4096 | 2048 |
| intermediate_size | 6400 | 3200 |
| num_attention_heads | 32 | 16 |
| num_key_value_heads | 8 | 4 |
| num_experts_per_tok | 2 | 2 |
block_sparse_moe for MoE layersw1, w2, w3 weights per expert1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model = AutoModelForCausalLM.from_pretrained("inference-optimization/Phi-3.5-MoE-0.8B-A0.2B", device_map="auto")
4tokenizer = AutoTokenizer.from_pretrained("inference-optimization/Phi-3.5-MoE-0.8B-A0.2B")
5
6input_ids = tokenizer("According to all known laws", return_tensors="pt").input_ids.to(model.device)
7output = model.generate(input_ids, max_new_tokens=20)
8print(tokenizer.decode(output[0]))Success: 1.0009158849716187 <= 10.0
==================================================
Generating sample text:
According to all known laws of aviation, there is no way a bee should be able to
==================================================create-tiny-model skill: