LazyMergekit-Qwen2.5-0.5B-Mixtral

LazyMergekit-Qwen2.5-0.5B-Mixtral is a Mixture of Experts (MoE) made with the following models using LazyMergekit:

🧩 Configuration

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:
      

πŸ’» Usage

!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"])
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model is not currently available via any of the supported Inference Providers.
The model cannot be deployed to the HF Inference API: The model has no library tag.

Model tree for Xiaojian9992024/LazyMergekit-Qwen2.5-0.5B-Mixtral