FuseChat: Knowledge Fusion of Chat Models
Paper • 2408.07990 • Published • 15
How to use agentlans/Llama3.1-LexiHermes-SuperStorm with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="agentlans/Llama3.1-LexiHermes-SuperStorm")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("agentlans/Llama3.1-LexiHermes-SuperStorm")
model = AutoModelForCausalLM.from_pretrained("agentlans/Llama3.1-LexiHermes-SuperStorm")
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 agentlans/Llama3.1-LexiHermes-SuperStorm with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "agentlans/Llama3.1-LexiHermes-SuperStorm"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "agentlans/Llama3.1-LexiHermes-SuperStorm",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/agentlans/Llama3.1-LexiHermes-SuperStorm
How to use agentlans/Llama3.1-LexiHermes-SuperStorm with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "agentlans/Llama3.1-LexiHermes-SuperStorm" \
--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": "agentlans/Llama3.1-LexiHermes-SuperStorm",
"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 "agentlans/Llama3.1-LexiHermes-SuperStorm" \
--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": "agentlans/Llama3.1-LexiHermes-SuperStorm",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use agentlans/Llama3.1-LexiHermes-SuperStorm with Docker Model Runner:
docker model run hf.co/agentlans/Llama3.1-LexiHermes-SuperStorm
A mix of four high-performing models using the new SCE merging technique. This model was created using mergekit.
Models Merged
Base model: mlabonne/Meta-Llama-3.1-8B-Instruct-abliterated
The following YAML configuration was used:
models:
- model: Hermes-3-Llama-3.1-8B
- model: Llama-3.1-8B-Lexi-Uncensored-V2
- model: Llama-3.1-SuperNova-Lite
- model: Llama-3.1-Storm-8B
merge_method: sce
base_model: Meta-Llama-3.1-8B-Instruct-abliterated
parameters:
select_topk: 1.5
dtype: bfloat16
Detailed results can be found here! Summarized results can be found here!
| Metric | Value (%) |
|---|---|
| Average | 29.43 |
| IFEval (0-Shot) | 78.35 |
| BBH (3-Shot) | 32.55 |
| MATH Lvl 5 (4-Shot) | 16.16 |
| GPQA (0-shot) | 9.73 |
| MuSR (0-shot) | 8.20 |
| MMLU-PRO (5-shot) | 31.60 |