Text Generation
MLX
Safetensors
Hungarian
llama
hungarian
emese
from-scratch
base-model
apple-silicon
Instructions to use emese-tech/er with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use emese-tech/er with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # if on a CUDA device, also pip install mlx[cuda] # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("emese-tech/er") prompt = "Once upon a time in" text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- MLX LM
How to use emese-tech/er with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Generate some text mlx_lm.generate --model "emese-tech/er" --prompt "Once upon a time"
- Atomic Chat
Upload folder using huggingface_hub
Browse files- README.md +88 -0
- config.json +19 -0
- model.safetensors +3 -0
- special_tokens_map.json +30 -0
- tokenizer.model +3 -0
- tokenizer_config.json +12 -0
README.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- hu
|
| 4 |
+
license: mit
|
| 5 |
+
library_name: mlx
|
| 6 |
+
tags:
|
| 7 |
+
- hungarian
|
| 8 |
+
- emese
|
| 9 |
+
- from-scratch
|
| 10 |
+
- llama
|
| 11 |
+
- base-model
|
| 12 |
+
- mlx
|
| 13 |
+
- apple-silicon
|
| 14 |
+
pipeline_tag: text-generation
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
# Emese-Ér (517M)
|
| 18 |
+
|
| 19 |
+
**Ér** ("brook/rill" — the smallest flowing water in the family name scheme) is the edge/embedded/research
|
| 20 |
+
tier of the [Emese](https://emese.tech) Hungarian model family. Unlike the other three tiers, Ér is
|
| 21 |
+
**not** built on EuroLLM — it's a from-scratch Hungarian foundation model, pretrained on ~4.5B tokens of
|
| 22 |
+
Hungarian text with a custom 32k SentencePiece tokenizer.
|
| 23 |
+
|
| 24 |
+
| | |
|
| 25 |
+
|---|---|
|
| 26 |
+
| **Parameters** | 516.8M |
|
| 27 |
+
| **Base** | none — from-scratch pretraining |
|
| 28 |
+
| **Architecture** | LLaMA-style decoder (RoPE + YaRN, RMSNorm, SwiGLU, tied embeddings) |
|
| 29 |
+
| **Hidden / layers / heads** | 1280 / 24 / 20 |
|
| 30 |
+
| **FFN size** | 3456 |
|
| 31 |
+
| **Vocabulary** | 32,000 (custom Hungarian SentencePiece Unigram) |
|
| 32 |
+
| **Max context length** | **32,768 tokens** (trained at 1,024, YaRN-extended to 8,192 during CPT, RoPE scale 4.0 rated to 32,768) |
|
| 33 |
+
| **Precision** | bfloat16 |
|
| 34 |
+
| **License** | MIT |
|
| 35 |
+
|
| 36 |
+
## Formats in this release
|
| 37 |
+
|
| 38 |
+
| Folder | Format | Notes |
|
| 39 |
+
|---|---|---|
|
| 40 |
+
| `er/` (this repo) | bf16, MLX-native safetensors | **not** a standard `transformers` repo — see below |
|
| 41 |
+
| `er-mlx/` | MLX q8 | `mlx_lm`-loadable, quantized |
|
| 42 |
+
|
| 43 |
+
## ⚠️ Not `transformers`-compatible out of the box
|
| 44 |
+
|
| 45 |
+
Ér predates the EuroLLM/Llama-arch pipeline used for Csermely/Patak/Folyó. Its `config.json` uses a
|
| 46 |
+
custom schema (`d_model`, `n_layers`, `n_heads`, `d_ff` — not HF's `hidden_size`/`num_hidden_layers`/...)
|
| 47 |
+
and its weight tensor names are custom (`embed.weight`, `layers.N.attn.wq.weight`, ...), not the standard
|
| 48 |
+
`model.embed_tokens.weight` / `model.layers.N.self_attn.q_proj.weight` naming. **`AutoModelForCausalLM.
|
| 49 |
+
from_pretrained` will fail on this repo.** Use the project's own `model.py` (an MLX `Emese` class) or load
|
| 50 |
+
`er-mlx/` via `mlx_lm`, which does understand this checkpoint despite the non-standard config.
|
| 51 |
+
|
| 52 |
+
## Usage (MLX, via mlx_lm)
|
| 53 |
+
|
| 54 |
+
```python
|
| 55 |
+
from mlx_lm import load, generate
|
| 56 |
+
model, tok = load("er-mlx") # or "er" — both load via mlx_lm
|
| 57 |
+
print(generate(model, tok, prompt="A magyar nyelv", max_tokens=100))
|
| 58 |
+
```
|
| 59 |
+
|
| 60 |
+
## Usage (project's own loader)
|
| 61 |
+
|
| 62 |
+
```bash
|
| 63 |
+
python generate.py --model models-release/er/ --prompt "A magyar nyelv"
|
| 64 |
+
```
|
| 65 |
+
|
| 66 |
+
## Training
|
| 67 |
+
|
| 68 |
+
- **Pretraining (from scratch):** ~4.5B tokens of Hungarian text (the same corpus family documented in
|
| 69 |
+
`corpus/cpt/README.md`: Wikipedia + HPLT web text, quality-filtered). No separate "CPT" stage — this
|
| 70 |
+
*is* the base pretraining, there is no upstream foundation model underneath it.
|
| 71 |
+
|
| 72 |
+
## Benchmarks
|
| 73 |
+
|
| 74 |
+
**Not applicable** — `emese-bench` (and its Ultimate/BlindSpot predecessors) are chat-instruction
|
| 75 |
+
benchmarks (ChatML turns, persona/safety/instruction-following categories); Ér has no chat template or
|
| 76 |
+
instruction-tuning, so scoring it on those benchmarks would not be a meaningful comparison against the
|
| 77 |
+
other three tiers. During development it was evaluated on HuCoLA (Hungarian grammatical-acceptability
|
| 78 |
+
classification) instead, not on chat-style benchmarks.
|
| 79 |
+
- **No SFT / no DPO.** Ér ships as a **base/research model only** — it has no chat template, no persona
|
| 80 |
+
training, no instruction-tuning. It is not conversational; treat it as a research/embedding artifact for
|
| 81 |
+
downstream fine-tuning experiments, not an assistant.
|
| 82 |
+
|
| 83 |
+
## Limitations
|
| 84 |
+
|
| 85 |
+
- Base model only — expects raw text continuation, not chat-formatted prompts.
|
| 86 |
+
- Smallest tier by a wide margin (517M vs. 1.7B+ for the rest of the family) — limited world knowledge and
|
| 87 |
+
reasoning capacity even relative to Csermely.
|
| 88 |
+
- Requires custom loading code (`model.py`) for anything beyond `mlx_lm`.
|
config.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model_type": "llama",
|
| 3 |
+
"vocab_size": 32000,
|
| 4 |
+
"d_model": 1280,
|
| 5 |
+
"n_layers": 24,
|
| 6 |
+
"n_heads": 20,
|
| 7 |
+
"d_ff": 3456,
|
| 8 |
+
"max_seq_len": 8192,
|
| 9 |
+
"rope_theta": 10000.0,
|
| 10 |
+
"rope_yarn": true,
|
| 11 |
+
"rope_yarn_scale": 4.0,
|
| 12 |
+
"rms_norm_eps": 1e-6,
|
| 13 |
+
"tie_word_embeddings": true,
|
| 14 |
+
"torch_dtype": "bfloat16",
|
| 15 |
+
"repetition_penalty": 1.2,
|
| 16 |
+
"bos_token_id": 2,
|
| 17 |
+
"eos_token_id": 3,
|
| 18 |
+
"pad_token_id": 1
|
| 19 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fbfd0c6df6e03db5f30f3dcff2332c7153ef4234acfeff75c8c05e7d1deb2076
|
| 3 |
+
size 1033649911
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token": {
|
| 3 |
+
"content": "<bos>",
|
| 4 |
+
"lstrip": false,
|
| 5 |
+
"normalized": false,
|
| 6 |
+
"rstrip": false,
|
| 7 |
+
"single_word": false
|
| 8 |
+
},
|
| 9 |
+
"eos_token": {
|
| 10 |
+
"content": "<eos>",
|
| 11 |
+
"lstrip": false,
|
| 12 |
+
"normalized": false,
|
| 13 |
+
"rstrip": false,
|
| 14 |
+
"single_word": false
|
| 15 |
+
},
|
| 16 |
+
"unk_token": {
|
| 17 |
+
"content": "<unk>",
|
| 18 |
+
"lstrip": false,
|
| 19 |
+
"normalized": false,
|
| 20 |
+
"rstrip": false,
|
| 21 |
+
"single_word": false
|
| 22 |
+
},
|
| 23 |
+
"pad_token": {
|
| 24 |
+
"content": "<pad>",
|
| 25 |
+
"lstrip": false,
|
| 26 |
+
"normalized": false,
|
| 27 |
+
"rstrip": false,
|
| 28 |
+
"single_word": false
|
| 29 |
+
}
|
| 30 |
+
}
|
tokenizer.model
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:244bb6facd57b3890990261b9932ab50d79630d5b35058c902a5c96c32fa2950
|
| 3 |
+
size 845117
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token": "<bos>",
|
| 3 |
+
"eos_token": "<eos>",
|
| 4 |
+
"unk_token": "<unk>",
|
| 5 |
+
"pad_token": "<pad>",
|
| 6 |
+
"sp_model_kwargs": {},
|
| 7 |
+
"add_bos_token": true,
|
| 8 |
+
"add_eos_token": false,
|
| 9 |
+
"model_max_length": 8192,
|
| 10 |
+
"tokenizer_class": "LlamaTokenizer",
|
| 11 |
+
"clean_up_tokenization_spaces": false
|
| 12 |
+
}
|