Downloads · 30 days
10
11% of all-time downloads
emanuelaboros/smol-historical-llm-test
smol-historical-llm-test is a text generation model from emanuelaboros. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
smol-historical-llm is a small experimental historical language model adapter based on HuggingFaceTB/SmolLM3-3B-Base.
Downloads · 30 days
10
11% of all-time downloads
All-time downloads
90
Public
Repo size
259 MB
Likes
0
Public
Click a slice to open those files.
.safetensors242 MB · 93%
From the Hugging Face model README
smol-historical-llm is a small experimental historical language model adapter based on HuggingFaceTB/SmolLM3-3B-Base.
It is trained with QLoRA-style continued pretraining / domain adaptation on French historical newspaper text from PleIAs/French-PD-Newspapers.
The goal is to adapt a compact open language model to historical newspaper language, OCR-style noise, old spelling, long documents, and cultural heritage material.
This repository contains a LoRA/PEFT adapter, not a fully merged standalone model.
emanuelaboros/smol-historical-llmemanuelaboros/smol-historical-llm-testHuggingFaceTB/SmolLM3-3B-BasePleIAs/French-PD-NewspapersThis model is intended for experimental research on historical and noisy document processing.
Potential uses include:
This model is not intended as a general-purpose assistant or instruction-following chatbot.
The adapter is trained on:
PleIAs/French-PD-Newspapers
This dataset contains French public-domain newspapers and periodicals, including OCR-derived historical text.
During training, documents are wrapped with simple control tokens:
<|historical_document|>
...
<|end_document|>
The default training script uses the complete_text column.
The training script performs continued pretraining / domain adaptation of the base causal language model.
Default configuration used in the training script:
base_model: HuggingFaceTB/SmolLM3-3B-Base
dataset: PleIAs/French-PD-Newspapers
text_column: complete_text
max_seq_length: 2048
LoRA r: 32
LoRA alpha: 64
LoRA dropout: 0.05
target modules: q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
optimizer: paged_adamw_8bit
precision: bf16
The smoke-test version may have been trained for only a few steps and should not be interpreted as a final domain-adapted model.
Install dependencies:
pip install -U transformers peft accelerate safetensors torch
Load the base model and the adapter:
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
import torch
base_model_id = "HuggingFaceTB/SmolLM3-3B-Base"
adapter_id = "emanuelaboros/smol-historical-llm"
tokenizer = AutoTokenizer.from_pretrained(
base_model_id,
trust_remote_code=True,
)
model = AutoModelForCausalLM.from_pretrained(
base_model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True,
)
model = PeftModel.from_pretrained(model, adapter_id)
model.eval()
prompt = """<|historical_document|>
Paris, 1894. Le journal rapporte que
"""
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=150,
do_sample=True,
temperature=0.8,
top_p=0.95,
pad_token_id=tokenizer.eos_token_id,
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
For the smoke-test adapter, replace:
adapter_id = "emanuelaboros/smol-historical-llm"
with:
adapter_id = "emanuelaboros/smol-historical-llm-test"
<|historical_document|>
Paris, 1894. Le journal rapporte que
The model should continue in a style closer to historical French newspaper prose than the unadapted base model.
A first evaluation should compare perplexity on held-out historical newspaper text.
Suggested baseline:
HuggingFaceTB/SmolLM3-3B-Base
Suggested adapted model:
emanuelaboros/smol-historical-llm
Optional comparison:
HuggingFaceTB/SmolLM3-3B
Example metrics to report:
| Model | Dataset | Split / skip | Docs | Tokens | Perplexity |
|---|---|---|---|---|---|
| SmolLM3-3B-Base | PleIAs/French-PD-Newspapers | held-out | TBD | TBD | TBD |
| Smol Historical LLM | PleIAs/French-PD-Newspapers | held-out | TBD | TBD | TBD |
Lower perplexity is better.
This is an experimental research model.
Known limitations:
Historical newspapers may contain outdated, offensive, colonial, racist, sexist, or otherwise harmful language and viewpoints. The model may reproduce such language because it is adapting to historical source material.
Outputs should be interpreted as generated text, not as factual historical evidence.
For scholarly or cultural heritage use, generated outputs should always be checked against primary sources.
If you use this model, please cite the base model and dataset:
@misc{smollm3base,
title = {SmolLM3-3B-Base},
author = {Hugging Face TB},
year = {2025},
url = {https://huggingface.co/HuggingFaceTB/SmolLM3-3B-Base}
}
@misc{frenchpdnewspapers,
title = {French Public Domain Newspapers},
author = {PleIAs},
url = {https://huggingface.co/datasets/PleIAs/French-PD-Newspapers}
}
This adapter builds on SmolLM3 from Hugging Face and historical newspaper data distributed by PleIAs.
This model card declares apache-2.0 to match the base model metadata. Users should also respect the licenses and terms of the base model and training dataset.