Jackrong/DeepSeek-V4-Distill-8000x
Viewer • Updated • 7.72k • 5.29k • 85
How to use laurent-maille/apertus-8b-deepseekv4-fr with PEFT:
from peft import PeftModel
from transformers import AutoModelForCausalLM
base_model = AutoModelForCausalLM.from_pretrained("swiss-ai/Apertus-8B-Instruct-2509")
model = PeftModel.from_pretrained(base_model, "laurent-maille/apertus-8b-deepseekv4-fr")How to use laurent-maille/apertus-8b-deepseekv4-fr with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="laurent-maille/apertus-8b-deepseekv4-fr")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("laurent-maille/apertus-8b-deepseekv4-fr")
model = AutoModelForCausalLM.from_pretrained("laurent-maille/apertus-8b-deepseekv4-fr")
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 laurent-maille/apertus-8b-deepseekv4-fr with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "laurent-maille/apertus-8b-deepseekv4-fr"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "laurent-maille/apertus-8b-deepseekv4-fr",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/laurent-maille/apertus-8b-deepseekv4-fr
How to use laurent-maille/apertus-8b-deepseekv4-fr with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "laurent-maille/apertus-8b-deepseekv4-fr" \
--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": "laurent-maille/apertus-8b-deepseekv4-fr",
"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 "laurent-maille/apertus-8b-deepseekv4-fr" \
--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": "laurent-maille/apertus-8b-deepseekv4-fr",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use laurent-maille/apertus-8b-deepseekv4-fr with Docker Model Runner:
docker model run hf.co/laurent-maille/apertus-8b-deepseekv4-fr
axolotl version: 0.16.2.dev0
base_model: swiss-ai/Apertus-8B-Instruct-2509
model_type: AutoModelForCausalLM
tokenizer_type: AutoTokenizer
trust_remote_code: true
load_in_4bit: true
bnb_4bit_quant_type: nf4
bnb_4bit_compute_dtype: bfloat16
bnb_4bit_use_double_quant: true
datasets:
- path: Jackrong/DeepSeek-V4-Distill-8000x
type:
field_instruction: input
field_output: output
format: |
### Instruction:
{instruction}
### Response:
no_input_format: |
### Instruction:
{instruction}
### Response:
#dataset_prepared_path: /data/prepared/apertus8b_deepseekv4
output_dir: /outputs/apertus-8b-deepseekv4-qlora
val_set_size: 0.05
sequence_len: 8192
sample_packing: true
pad_to_sequence_len: true
adapter: qlora
lora_r: 32
lora_alpha: 64
lora_dropout: 0.05
lora_target_linear: true
micro_batch_size: 2
gradient_accumulation_steps: 8
num_epochs: 3
optimizer: paged_adamw_8bit
learning_rate: 0.00015
lr_scheduler: cosine
warmup_ratio: 0.03
weight_decay: 0.0
bf16: true
tf32: true
gradient_checkpointing: true
logging_steps: 10
eval_steps: 100
save_steps: 100
save_total_limit: 3
#############################################
# HUGGING FACE HUB
#############################################
hub_model_id: laurent-maille/apertus-8b-deepseekv4-fr
hub_strategy: every_save
hf_use_auth_token: true
hub_private_repo: true
save_safetensors: true
#############################################
# OPTIONAL
#############################################
#wandb_project: apertus-8b-ft
#wandb_name: apertus-8b-deepseekv4
special_tokens:
pad_token: "<|endoftext|>"
This model is a fine-tuned version of swiss-ai/Apertus-8B-Instruct-2509 on the Jackrong/DeepSeek-V4-Distill-8000x dataset. It achieves the following results on the evaluation set:
More information needed
More information needed
More information needed
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss | Ppl | Active (gib) | Allocated (gib) | Reserved (gib) |
|---|---|---|---|---|---|---|---|
| No log | 0 | 0 | 4.0401 | 56.8296 | 26.06 | 26.06 | 27.67 |
| 1.2896 | 0.8282 | 100 | 1.2931 | 3.6441 | 26.08 | 26.08 | 43.39 |
| 1.2472 | 1.6625 | 200 | 1.2097 | 3.3524 | 26.08 | 26.08 | 43.84 |
| 1.2004 | 2.4886 | 300 | 1.1893 | 3.2847 | 26.08 | 26.08 | 43.84 |
| 1.1840 | 2.9855 | 360 | 1.1878 | 3.2797 | 26.08 | 26.08 | 43.59 |
Base model
swiss-ai/Apertus-8B-2509