Text Generation
Transformers
Safetensors
French
English
qwen3
dpo
post-training
french
alignment
model-merging
chocolatine
comparia
conversational
text-generation-inference
Instructions to use jpacifico/Chocolatine-2-4B-Instruct-DPO-v2.1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jpacifico/Chocolatine-2-4B-Instruct-DPO-v2.1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="jpacifico/Chocolatine-2-4B-Instruct-DPO-v2.1") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("jpacifico/Chocolatine-2-4B-Instruct-DPO-v2.1") model = AutoModelForMultimodalLM.from_pretrained("jpacifico/Chocolatine-2-4B-Instruct-DPO-v2.1") 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]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use jpacifico/Chocolatine-2-4B-Instruct-DPO-v2.1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "jpacifico/Chocolatine-2-4B-Instruct-DPO-v2.1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jpacifico/Chocolatine-2-4B-Instruct-DPO-v2.1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/jpacifico/Chocolatine-2-4B-Instruct-DPO-v2.1
- SGLang
How to use jpacifico/Chocolatine-2-4B-Instruct-DPO-v2.1 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "jpacifico/Chocolatine-2-4B-Instruct-DPO-v2.1" \ --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": "jpacifico/Chocolatine-2-4B-Instruct-DPO-v2.1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
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 "jpacifico/Chocolatine-2-4B-Instruct-DPO-v2.1" \ --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": "jpacifico/Chocolatine-2-4B-Instruct-DPO-v2.1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use jpacifico/Chocolatine-2-4B-Instruct-DPO-v2.1 with Docker Model Runner:
docker model run hf.co/jpacifico/Chocolatine-2-4B-Instruct-DPO-v2.1
Update README.md
Browse files
README.md
CHANGED
|
@@ -29,11 +29,14 @@ Optimized variants (MLX, GGUF) are also available, making the model particularly
|
|
| 29 |
## Model Overview
|
| 30 |
|
| 31 |
- **Base model:** Qwen/Qwen3-4B-Instruct-2507 (non-thinking)
|
| 32 |
-
- **Architecture:** Decoder-only transformer
|
| 33 |
- **Parameters:** 4.0B
|
| 34 |
-
- **
|
| 35 |
- **Post training methods:** DPO + Model Merging
|
| 36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
|
| 38 |
**Model Variants**
|
| 39 |
|
|
@@ -45,7 +48,7 @@ Optimized variants (MLX, GGUF) are also available, making the model particularly
|
|
| 45 |
|
| 46 |
Performance improves consistently across all tested FR benchmarks :
|
| 47 |
|
| 48 |
-
| Benchmark | Qwen3-4B-Thinking-2507 | Chocolatine-2-4B-Instruct-DPO-v2.1 |
|
| 49 |
|---|---:|---:|
|
| 50 |
| french_bench_arc_challenge | 47.13 | **49.79** |
|
| 51 |
| french_bench_grammar | 70.59 | **72.27** |
|
|
@@ -63,9 +66,9 @@ Chocolatine-2-4B-Instruct-DPO-v2.1 is derived from [Qwen/Qwen3-4B-Instruct-2507]
|
|
| 63 |
|
| 64 |
**Stage 1 – DPO (Compar:IA adaptation)**
|
| 65 |
|
| 66 |
-
Direct Preference Optimization (DPO) on a DPO-adapted version of **[Compar:IA](https://comparia.beta.gouv.fr/datasets)** data, derived from the preference dataset [comparia-votes](https://huggingface.co/datasets/ministere-culture/comparia-votes) of the French
|
| 67 |
-
|
| 68 |
-
Two dataset variants were
|
| 69 |
The **6k variant** was used for the DPO training reported in this release.
|
| 70 |
|
| 71 |
**Stage 2 – DPO (French-ORCA pairs)**
|
|
|
|
| 29 |
## Model Overview
|
| 30 |
|
| 31 |
- **Base model:** Qwen/Qwen3-4B-Instruct-2507 (non-thinking)
|
|
|
|
| 32 |
- **Parameters:** 4.0B
|
| 33 |
+
- **Context Length:** 262,144 natively
|
| 34 |
- **Post training methods:** DPO + Model Merging
|
| 35 |
+
|
| 36 |
+
Note: This model supports only non-thinking mode and does not generate `<think></think>` blocks in its outputs.
|
| 37 |
+
The choice of Qwen3 over Qwen3.5 is intentional: Qwen3 provides a more direct text-oriented generation style, better aligned with the objectives of this post-training. Empirically, my post-training on Qwen3 yielded *more consistent improvements across evaluated benchmarks* compared to Qwen3.5.
|
| 38 |
+
For use cases requiring explicit reasoning traces or structured thinking outputs, Qwen3.5 (thinking mode) is recommended.
|
| 39 |
+
Chocolatine-2-4B-Instruct-DPO-v2.1 is therefore optimized for direct instruction-following and practical deployment, rather than explicit CoT generation.
|
| 40 |
|
| 41 |
**Model Variants**
|
| 42 |
|
|
|
|
| 48 |
|
| 49 |
Performance improves consistently across all tested FR benchmarks :
|
| 50 |
|
| 51 |
+
| Benchmark | Qwen3-4B-Thinking-2507 (base) | Chocolatine-2-4B-Instruct-DPO-v2.1 |
|
| 52 |
|---|---:|---:|
|
| 53 |
| french_bench_arc_challenge | 47.13 | **49.79** |
|
| 54 |
| french_bench_grammar | 70.59 | **72.27** |
|
|
|
|
| 66 |
|
| 67 |
**Stage 1 – DPO (Compar:IA adaptation)**
|
| 68 |
|
| 69 |
+
Direct Preference Optimization (DPO) on a DPO-adapted version of **[Compar:IA](https://comparia.beta.gouv.fr/datasets)** data, derived from the preference dataset [comparia-votes](https://huggingface.co/datasets/ministere-culture/comparia-votes), part of a public initiative led by the Ministry of Culture (French gov). Previous iterations of the Chocolatine model series also were selected as part of this initiative.
|
| 70 |
+
I constructed an original DPO dataset from these votes by transforming them into preference pairs (chosen / rejected), with additional filtering and formatting steps to make them suitable for DPO fine-tuning.
|
| 71 |
+
Two dataset variants were created ([6k](https://huggingface.co/datasets/jpacifico/comparia-dpo-pairs-bt-6k) and [13k](https://huggingface.co/datasets/jpacifico/comparia-dpo-pairs-bt-13k) preference pairs).
|
| 72 |
The **6k variant** was used for the DPO training reported in this release.
|
| 73 |
|
| 74 |
**Stage 2 – DPO (French-ORCA pairs)**
|