Modèle de langage GPT-2 de 292M paramètres entraîné from-scratch sur corpus français. Architecture decoder-only transformer optimisée pour la génération de texte en français.
├─ Embedding layer: 32,000 × 1024
├─ Position embeddings: 1024 × 1024
├─ Transformer blocks: 18 layers
│ ├─ Multi-head attention: 16 heads, 64 dim/head
│ ├─ Feed-forward: 1024 → 4096 → 1024
│ ├─ LayerNorm (pre-norm architecture)
│ └─ Dropout: 0.1
└─ LM Head: 1024 → 32,000
Corpus combiné de ~375M tokens (197M tokens Mistral-tokenized) :
{
"max_steps": 200000,
"batch_size": 4,
"learning_rate": 3e-06,
"weight_decay": 0.0,
"optimizer": "AdamW (apex FusedAdam si disponible)",
"scheduler": "Cosine with warmup",
"precision": "mixed (AMP)",
"gradient_clipping": 1.0,
"dropout": 0.1,
"seed": 13
}
torch.compile(mode='max-autotune') : +15% vitesse| Metric | Value |
|---|---|
| Final train loss | ~4.5 |
| Final validation loss | ~4.79 |
| Perplexity (val) | ~120 |
| Training steps | 200,000 |
✅ Excellente - Génération cohérente, français fluide, grammaire correcte
pip install transformers safetensors tokenizers
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("Vincent-PRO-AI/french-gpt2-260m-fineweb32k")
tokenizer = AutoTokenizer.from_pretrained("Vincent-PRO-AI/french-gpt2-260m-fineweb32k")
# Génération
prompt = "Bonjour, comment vas-tu ?"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=100, temperature=0.8, top_k=50)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
from transformers import pipeline
generator = pipeline('text-generation', model='Vincent-PRO-AI/french-gpt2-260m-fineweb32k')
result = generator("Expliquez-moi l'intelligence artificielle", max_length=200)
print(result[0]['generated_text'])
MIT License - Utilisation libre pour recherche et production.
@misc{french-llm-from-scratch,
author = {Vincent-PRO-AI},
title = {French LLM From Scratch - 260M with Fineweb-32k Tokenizer},
year = {2025},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/Vincent-PRO-AI/french-llm-from-scratch}}
}
Modèle entraîné between November 2 et November 2
10 commits
Modèle de langage GPT-2 de 292M paramètres entraîné from-scratch sur corpus français. Architecture decoder-only transformer optimisée pour la génération de texte en français.
├─ Embedding layer: 32,000 × 1024
├─ Position embeddings: 1024 × 1024
├─ Transformer blocks: 18 layers
│ ├─ Multi-head attention: 16 heads, 64 dim/head
│ ├─ Feed-forward: 1024 → 4096 → 1024
│ ├─ LayerNorm (pre-norm architecture)
│ └─ Dropout: 0.1
└─ LM Head: 1024 → 32,000
Corpus combiné de ~375M tokens (197M tokens Mistral-tokenized) :
{
"max_steps": 200000,
"batch_size": 4,
"learning_rate": 3e-06,
"weight_decay": 0.0,
"optimizer": "AdamW (apex FusedAdam si disponible)",
"scheduler": "Cosine with warmup",
"precision": "mixed (AMP)",
"gradient_clipping": 1.0,
"dropout": 0.1,
"seed": 13
}
torch.compile(mode='max-autotune') : +15% vitesse| Metric | Value |
|---|---|
| Final train loss | ~4.5 |
| Final validation loss | ~4.79 |
| Perplexity (val) | ~120 |
| Training steps | 200,000 |
✅ Excellente - Génération cohérente, français fluide, grammaire correcte
pip install transformers safetensors tokenizers
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("Vincent-PRO-AI/french-gpt2-260m-fineweb32k")
tokenizer = AutoTokenizer.from_pretrained("Vincent-PRO-AI/french-gpt2-260m-fineweb32k")
# Génération
prompt = "Bonjour, comment vas-tu ?"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=100, temperature=0.8, top_k=50)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
from transformers import pipeline
generator = pipeline('text-generation', model='Vincent-PRO-AI/french-gpt2-260m-fineweb32k')
result = generator("Expliquez-moi l'intelligence artificielle", max_length=200)
print(result[0]['generated_text'])
MIT License - Utilisation libre pour recherche et production.
@misc{french-llm-from-scratch,
author = {Vincent-PRO-AI},
title = {French LLM From Scratch - 260M with Fineweb-32k Tokenizer},
year = {2025},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/Vincent-PRO-AI/french-llm-from-scratch}}
}
Modèle entraîné between November 2 et November 2
10 commits