Language Models are Super Mario: Absorbing Abilities from Homologous Models as a Free Lunch
Paper • 2311.03099 • Published • 33
How to use CultriX/Qwen2.5-DeepHyper with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="CultriX/Qwen2.5-DeepHyper")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("CultriX/Qwen2.5-DeepHyper")
model = AutoModelForCausalLM.from_pretrained("CultriX/Qwen2.5-DeepHyper")
messages = [
{"role": "user", "content": "Who are you?"},
]
inputs = tokenizer.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=40)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))How to use CultriX/Qwen2.5-DeepHyper with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "CultriX/Qwen2.5-DeepHyper"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "CultriX/Qwen2.5-DeepHyper",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/CultriX/Qwen2.5-DeepHyper
How to use CultriX/Qwen2.5-DeepHyper with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "CultriX/Qwen2.5-DeepHyper" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "CultriX/Qwen2.5-DeepHyper",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker run --gpus all \
--shm-size 32g \
-p 30000:30000 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
--env "HF_TOKEN=<secret>" \
--ipc=host \
lmsysorg/sglang:latest \
python3 -m sglang.launch_server \
--model-path "CultriX/Qwen2.5-DeepHyper" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "CultriX/Qwen2.5-DeepHyper",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use CultriX/Qwen2.5-DeepHyper with Docker Model Runner:
docker model run hf.co/CultriX/Qwen2.5-DeepHyper
This is a merge of pre-trained language models created using mergekit.
This model was merged using the DARE TIES merge method using Qwen/Qwen2.5-14B as a base.
The following models were included in the merge:
The following YAML configuration was used to produce this model:
base_model: Qwen/Qwen2.5-14B
models:
# Each adapter was extracted (rank=128) from its respective finetuned model.
# Their weights are set lower than the full instruct model (which is now the base)
- model: CultriX/Qwen2.5-14B-Hyperionv3_r128
parameters:
weight: 0.9 # Reduced weight relative to base
density: 0.9
- model: CultriX/Qwen2.5-14B_Virtuoso-small-v2-LoRA_r128
parameters:
weight: 1.0
density: 1.0
- model: Qwen/Qwen2.5-14B-Instruct
parameters:
weight: 0.75
density: 0.75
- model: /root/.cache/huggingface/hub/models--CultriX--Qwen2.5-14B-DeepSeek_r128/snapshots/1bca847f92fced165076d9ac921a1e3ef01fcd7f/
parameters:
weight: 1.00
density: 1.00
# Merging method and overall parameters
merge_method: dare_ties # Ties corresponding weights across sources.
parameters:
weight: 1.0 # Overall scaling factor.
density: 1.0 # Overall density (typically left at 1.0).
normalize: true # Normalize each set of weights before merging.
int8_mask: true # Enable masking if using int8 quantized weights.
# Use the instruct tokenizer to ensure compatibility.
tokenizer_source: CultriX/Qwen2.5-14B_Virtuoso-small-v2-LoRA_r128
# Data type for merged weights.
dtype: bfloat16