Model Stock: All we need is just a few fine-tuned models
Paper • 2403.19522 • Published • 15
How to use SanXM1/Driftwood-12B with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="SanXM1/Driftwood-12B")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("SanXM1/Driftwood-12B")
model = AutoModelForCausalLM.from_pretrained("SanXM1/Driftwood-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 SanXM1/Driftwood-12B with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "SanXM1/Driftwood-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": "SanXM1/Driftwood-12B",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/SanXM1/Driftwood-12B
How to use SanXM1/Driftwood-12B with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "SanXM1/Driftwood-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": "SanXM1/Driftwood-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 "SanXM1/Driftwood-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": "SanXM1/Driftwood-12B",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use SanXM1/Driftwood-12B with Docker Model Runner:
docker model run hf.co/SanXM1/Driftwood-12B
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 "SanXM1/Driftwood-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": "SanXM1/Driftwood-12B",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'This is a merge of pre-trained language models created using mergekit.
Basically. How many fucking models can you merge into 1 and still stay coherent, 24 is the answer (Though i might do a bigger one)
FP8: https://huggingface.co/SanXM1/Driftwood-12b-FP8/ EXL2: https://huggingface.co/NewEden/Delta-Vector_driftwood-exl2
This model was merged using the Model Stock merge method using IntervitensInc/Mistral-Nemo-Base-2407-chatml as a base.
The following models were included in the merge:
The following YAML configuration was used to produce this model:
models:
- model: Delta-Vector/Rei-12B
- model: natong19/Mistral-Nemo-Instruct-2407-abliterated
- model: Nitral-AI/Captain-Eris_Violet-GRPO-v0.420
- model: Nitral-AI/Wayfarer_Eris_Noctis-12B
- model: LatitudeGames/Wayfarer-12B
- model: PygmalionAI/Pygmalion-3-12B
- model: allura-org/Bigger-Body-12b
- model: allura-org/MN-12b-RP-Ink
- model: PocketDoc/Dans-SakuraKaze-V1.0.0-12b
- model: PocketDoc/Dans-DangerousWinds-V1.1.0-12b
- model: PocketDoc/Dans-PersonalityEngine-V1.1.0-12b
- model: Delta-Vector/Ohashi-NeMo-12B
- model: Delta-Vector/Francois-Huali-12B
- model: anthracite-org/magnum-v4-12b
- model: Undi95/LocalC-12B-e2.0
- model: NeverSleep/Lumimaid-v0.2-12B
- model: Fizzarolli/MN-12b-Sunrose
- model: anthracite-org/magnum-v2.5-12b-kto
- model: elinas/Chronos-Gold-12B-1.0
- model: nbeerbower/mistral-nemo-bophades-12B
- model: nbeerbower/mistral-nemo-gutenberg-12B-v4
- model: nbeerbower/mistral-nemo-wissenschaft-12B
- model: nbeerbower/Mistral-Nemo-Prism-12B
- model: nbeerbower/Lyra4-Gutenberg2-12B
merge_method: model_stock
base_model: IntervitensInc/Mistral-Nemo-Base-2407-chatml
normalize: false
int8_mask: true
dtype: bfloat16
Install from pip and serve model
# Install SGLang from pip: pip install sglang# Start the SGLang server: python3 -m sglang.launch_server \ --model-path "SanXM1/Driftwood-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": "SanXM1/Driftwood-12B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'