Downloads · 30 days
982
70% of all-time downloads
inference-optimization/Phi-3.5-MoE-0.8B-A0.2B
Phi-3.5-MoE-0.8B-A0.2B is a text generation model from inference-optimization. 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.
This is a tiny version of microsoft/Phi-3.5-MoE-instruct created for testing and development.
Downloads · 30 days
982
70% of all-time downloads
All-time downloads
1.4K
Public
Parameters
803M
1.6 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors1.6 GB · 100%
From the Hugging Face model README
This is a tiny version of microsoft/Phi-3.5-MoE-instruct created for testing and development.
The following parameters were reduced from the original model:
| 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 |
This model is saved as a single safetensors file (model.safetensors) with the same tensor naming convention as the original model:
block_sparse_moe for MoE layersw1, w2, w3 weights per expertfrom transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("inference-optimization/Phi-3.5-MoE-0.8B-A0.2B", device_map="auto")
tokenizer = AutoTokenizer.from_pretrained("inference-optimization/Phi-3.5-MoE-0.8B-A0.2B")
input_ids = tokenizer("According to all known laws", return_tensors="pt").input_ids.to(model.device)
output = model.generate(input_ids, max_new_tokens=20)
print(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
==================================================
The model achieves a perplexity of ~1.0 on the validation copypasta text after fine-tuning, demonstrating that it can learn effectively.
This model was created using the llm-compressor create-tiny-model skill: