Resolving Interference When Merging Models
Paper • 2306.01708 • Published • 19
How to use safe049/ParuMaid-Claude-Chinese-8B with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="safe049/ParuMaid-Claude-Chinese-8B")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("safe049/ParuMaid-Claude-Chinese-8B", dtype="auto")How to use safe049/ParuMaid-Claude-Chinese-8B with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "safe049/ParuMaid-Claude-Chinese-8B"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "safe049/ParuMaid-Claude-Chinese-8B",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/safe049/ParuMaid-Claude-Chinese-8B
How to use safe049/ParuMaid-Claude-Chinese-8B with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "safe049/ParuMaid-Claude-Chinese-8B" \
--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": "safe049/ParuMaid-Claude-Chinese-8B",
"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 "safe049/ParuMaid-Claude-Chinese-8B" \
--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": "safe049/ParuMaid-Claude-Chinese-8B",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use safe049/ParuMaid-Claude-Chinese-8B with Docker Model Runner:
docker model run hf.co/safe049/ParuMaid-Claude-Chinese-8B
This is a merge of pre-trained language models created using mergekit.
This model was merged using the TIES merge method using safe049/ParuMaid-Llama3-Chinese-8B as a base.
The following models were included in the merge:
The following YAML configuration was used to produce this model:
# 使用 ties 方法进行模型合并的配置文件
base_model: "safe049/ParuMaid-Llama3-Chinese-8B" # 设置 ParuMaid-Llama3-Chinese-8B 作为基础模型
models:
- model: "safe049/ParuMaid-Llama3-Chinese-8B"
- model: "Undi95/Meta-Llama-3.1-8B-Claude"
parameters:
density: 0.5 # 控制合并中的稀疏度
weight: 0.5 # 合并权重,控制该模型对输出的影响
merge_method: ties # 选择 ties 作为合并方法
parameters:
normalize: false # 是否进行归一化处理
int8_mask: true # 使用 int8 掩码以降低内存占用
dtype: float16 # 设置为半精度浮点数以减少显存需求