DELLA-Merging: Reducing Interference in Model Merging through Magnitude-Based Sampling
Paper • 2406.11617 • Published • 10
How to use Vortex5/Luminous-Shadow-12B with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="Vortex5/Luminous-Shadow-12B")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("Vortex5/Luminous-Shadow-12B")
model = AutoModelForCausalLM.from_pretrained("Vortex5/Luminous-Shadow-12B")
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 Vortex5/Luminous-Shadow-12B with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "Vortex5/Luminous-Shadow-12B"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "Vortex5/Luminous-Shadow-12B",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/Vortex5/Luminous-Shadow-12B
How to use Vortex5/Luminous-Shadow-12B with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "Vortex5/Luminous-Shadow-12B" \
--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": "Vortex5/Luminous-Shadow-12B",
"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 "Vortex5/Luminous-Shadow-12B" \
--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": "Vortex5/Luminous-Shadow-12B",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use Vortex5/Luminous-Shadow-12B with Docker Model Runner:
docker model run hf.co/Vortex5/Luminous-Shadow-12B
“Within the deepest shadow, the brightest light awaits.”
models:
- model: Retreatcost/KansenSakura-Radiance-RP-12b
parameters:
weight:
- filter: self_attn
value: [0.2, 0.25, 0.35, 0.55, 0.7, 0.8, 0.65, 0.4]
- filter: mlp
value: [0.25, 0.35, 0.25, 0.44]
- filter: norm
value: 0.35
- value: 0.40
density: 0.45
epsilon: 0.25
- model: Retreatcost/Ollpheist-12B
parameters:
weight:
- filter: self_attn
value: [0.0, 0.1, 0.25, 0.45, 0.55, 0.45, 0.25, 0.1]
- filter: mlp
value: [0.0, 0.15, 0.3, 0.5, 0.7, 0.55, 0.35, 0.15]
- filter: norm
value: 0.25
- filter: lm_head
value: 0.4
- value: 0.25
density: 0.4
epsilon: 0.35
- model: Vortex5/Shadow-Crystal-12B
parameters:
weight:
- filter: self_attn
value: [0.2, 0.2, 0.15, 0.35, 0.55, 0.55, 0.25, 0.6]
- filter: mlp
value: [0.0, 0.1, 0.25, 0.5, 0.4, 0.4, 0.65, 0.65]
- filter: lm_head
value: 0.55
- filter: norm
value: 0.15
- value: 0.15
density: 0.35
epsilon: 0.25
merge_method: della
base_model: Vortex5/MegaMoon-Karcher-12B
parameters:
lambda: 1.0
normalize: true
dtype: bfloat16
tokenizer:
source: Retreatcost/KansenSakura-Radiance-RP-12b