Text Generation
Transformers
Safetensors
English
llama
historical
causal-lm
knowledge-distillation
synthetic-data
babylm
text-generation-inference
Instructions to use Hplm/edgar-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Hplm/edgar-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Hplm/edgar-base")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Hplm/edgar-base") model = AutoModelForCausalLM.from_pretrained("Hplm/edgar-base", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Hplm/edgar-base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Hplm/edgar-base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Hplm/edgar-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Hplm/edgar-base
- SGLang
How to use Hplm/edgar-base 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 "Hplm/edgar-base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Hplm/edgar-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "Hplm/edgar-base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Hplm/edgar-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Hplm/edgar-base with Docker Model Runner:
docker model run hf.co/Hplm/edgar-base
Update README.md
Browse files
README.md
CHANGED
|
@@ -15,9 +15,9 @@ tags:
|
|
| 15 |
|
| 16 |
# Edgar-base
|
| 17 |
|
| 18 |
-
Edgar-base is a 632M-parameter
|
| 19 |
-
from 1786–1849, augmented with synthetic data derived from that same material.
|
| 20 |
-
|
| 21 |
|
| 22 |
## Model details
|
| 23 |
|
|
@@ -45,13 +45,11 @@ base (pretrained-only) model: it continues text and has not been instruction-tun
|
|
| 45 |
The design is deep and thin with grouped-query attention and tied embeddings, scaled up from
|
| 46 |
the BabyLlama-2 recipe.
|
| 47 |
|
| 48 |
-
## Intended
|
| 49 |
|
| 50 |
- Text continuation in the register of 1786–1849 English prose and verse.
|
| 51 |
-
- A base for further fine-tuning (instruction tuning, author-specific adaptation).
|
| 52 |
-
- Research on
|
| 53 |
-
|
| 54 |
-
It is not a chat model and has no chat template. Prompt it with the beginning of a passage.
|
| 55 |
|
| 56 |
## How to use
|
| 57 |
|
|
@@ -71,7 +69,7 @@ print(tok.decode(out[0], skip_special_tokens=True))
|
|
| 71 |
|
| 72 |
The corpus mixes two streams:
|
| 73 |
|
| 74 |
-
- **Real:** English-language texts dated 1786–1849.
|
| 75 |
- **Synthetic:** gated synthetic rewrites and augmentations.
|
| 76 |
|
| 77 |
The assembled training set is 363.7M tokens; the dev set is 5.8M tokens.
|
|
@@ -85,6 +83,8 @@ Training follows the BabyLlama-style ensemble distillation recipe:
|
|
| 85 |
3. The student (this model) was trained on the same corpus with an equal-weight blend of
|
| 86 |
cross-entropy on the data and KL divergence to the averaged teacher logits.
|
| 87 |
|
|
|
|
|
|
|
| 88 |
| Hyperparameter | Value |
|
| 89 |
|---|---|
|
| 90 |
| Epochs | 4 (about 1.45B tokens seen) |
|
|
@@ -107,19 +107,16 @@ Results on the held-out dev set at the end of training:
|
|
| 107 |
| Teacher 2 | 3.295 | 27.0 |
|
| 108 |
| **Student (this model)** | **3.202** | **24.6** |
|
| 109 |
|
| 110 |
-
|
| 111 |
|
| 112 |
## Limitations and biases
|
| 113 |
|
| 114 |
- The model reflects the language, knowledge and attitudes of its source period, including
|
| 115 |
views that are offensive or false by present standards. It has no knowledge of anything
|
| 116 |
-
after 1849 by design
|
| 117 |
-
generator.
|
| 118 |
-
- It was trained at a sequence length of 512; quality beyond that length is untested even
|
| 119 |
-
though the position limit is 1024.
|
| 120 |
-
- It is a base model and will not reliably follow instructions.
|
| 121 |
|
| 122 |
## Citation
|
| 123 |
|
| 124 |
-
|
| 125 |
*Pretraining Language Models for Diachronic Linguistic Change Discovery*.
|
|
|
|
|
|
| 15 |
|
| 16 |
# Edgar-base
|
| 17 |
|
| 18 |
+
Edgar-base is a 632M-parameter language model trained from scratch on English text
|
| 19 |
+
from 1786–1849, augmented with synthetic data derived from that same material. This is a
|
| 20 |
+
non instruction-tuned checkpoint.
|
| 21 |
|
| 22 |
## Model details
|
| 23 |
|
|
|
|
| 45 |
The design is deep and thin with grouped-query attention and tied embeddings, scaled up from
|
| 46 |
the BabyLlama-2 recipe.
|
| 47 |
|
| 48 |
+
## Intended uses
|
| 49 |
|
| 50 |
- Text continuation in the register of 1786–1849 English prose and verse.
|
| 51 |
+
- A lightweight base for further fine-tuning (instruction tuning, and especially author-specific adaptation).
|
| 52 |
+
- Research on leakage and fidelity in domain-limited models.
|
|
|
|
|
|
|
| 53 |
|
| 54 |
## How to use
|
| 55 |
|
|
|
|
| 69 |
|
| 70 |
The corpus mixes two streams:
|
| 71 |
|
| 72 |
+
- **Real:** English-language texts dated 1786–1849. Primarily Gutenberg derived, with some news articles.
|
| 73 |
- **Synthetic:** gated synthetic rewrites and augmentations.
|
| 74 |
|
| 75 |
The assembled training set is 363.7M tokens; the dev set is 5.8M tokens.
|
|
|
|
| 83 |
3. The student (this model) was trained on the same corpus with an equal-weight blend of
|
| 84 |
cross-entropy on the data and KL divergence to the averaged teacher logits.
|
| 85 |
|
| 86 |
+
Overparamaterization relative to data sizing is intentional; the lever is high weight decay
|
| 87 |
+
|
| 88 |
| Hyperparameter | Value |
|
| 89 |
|---|---|
|
| 90 |
| Epochs | 4 (about 1.45B tokens seen) |
|
|
|
|
| 107 |
| Teacher 2 | 3.295 | 27.0 |
|
| 108 |
| **Student (this model)** | **3.202** | **24.6** |
|
| 109 |
|
| 110 |
+
Filtered BLIMP: 0.72
|
| 111 |
|
| 112 |
## Limitations and biases
|
| 113 |
|
| 114 |
- The model reflects the language, knowledge and attitudes of its source period, including
|
| 115 |
views that are offensive or false by present standards. It has no knowledge of anything
|
| 116 |
+
after 1849 by design.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 117 |
|
| 118 |
## Citation
|
| 119 |
|
| 120 |
+
Currently, if you use this model, please cite the paper the training framework accompanies:
|
| 121 |
*Pretraining Language Models for Diachronic Linguistic Change Discovery*.
|
| 122 |
+
An additional preprint will come shortly.
|