Downloads · 30 days
0
Xiaojian9992024/LazyMergekit-Qwen2.5-0.5B-Mixtral
LazyMergekit-Qwen2.5-0.5B-Mixtral is a machine learning model from Xiaojian9992024. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
LazyMergekit-Qwen2.5-0.5B-Mixtral is a Mixture of Experts (MoE) made with the following models using LazyMergekit: Qwen/Qwen2.5-0.5B-Instruct Qwen/Qwen2.5-Coder-0.5B
Downloads · 30 days
0
Access
Public
Updated Jan 12, 2025
Repo size
—
Likes
0
Public
Click a slice to open those files.
.md2.8 KB · 65%
From the Hugging Face model README
LazyMergekit-Qwen2.5-0.5B-Mixtral is a Mixture of Experts (MoE) made with the following models using LazyMergekit:
base_model: Qwen/Qwen2.5-0.5B-Instruct # Base model for shared layers
gate_mode: hidden # Use hidden representations for router initialization
dtype: float16 # Data type for the merged model
experts:
- source_model: Qwen/Qwen2.5-0.5B-Instruct
positive_prompts:
- "chat"
- "assistant"
- "tell me"
- "explain"
- "I want"
- source_model: Qwen/Qwen2.5-Coder-0.5B
positive_prompts:
- "code"
- "python"
- "javascript"
- "programming"
- "algorithm"
- source_model: funnyPhani/Qwen-2.5-0.5B-MATH
positive_prompts:
- "math"
- "mathematics"
- "solve"
- "count"
- "reason"
- source_model: caelancooper/Qwen2.5-0.5B-business
positive_prompts:
- "business"
- "finance"
- "market"
- "strategy"
- "analysis"
- source_model: KingNish/Qwen2.5-0.5b-Test-ft
positive_prompts:
!pip install -qU transformers bitsandbytes accelerate
from transformers import AutoTokenizer
import transformers
import torch
model = "Xiaojian9992024/LazyMergekit-Qwen2.5-0.5B-Mixtral"
tokenizer = AutoTokenizer.from_pretrained(model)
pipeline = transformers.pipeline(
"text-generation",
model=model,
model_kwargs={"torch_dtype": torch.float16, "load_in_4bit": True},
)
messages = [{"role": "user", "content": "Explain what a Mixture of Experts is in less than 100 words."}]
prompt = pipeline.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
print(outputs[0]["generated_text"])