Upload 3 files
Browse files- README.md +100 -132
- data/test.parquet +3 -0
- data/train.parquet +3 -0
README.md
CHANGED
|
@@ -1,132 +1,100 @@
|
|
| 1 |
-
---
|
| 2 |
-
language:
|
| 3 |
-
- de
|
| 4 |
-
license:
|
| 5 |
-
- cc0-1.0
|
| 6 |
-
- mit
|
| 7 |
-
license_details: "Text content (Schiller's works) is public domain (CC0). Pipeline code is MIT licensed."
|
| 8 |
-
task_categories:
|
| 9 |
-
- text-generation
|
| 10 |
-
pretty_name: tiny_schiller
|
| 11 |
-
size_categories:
|
| 12 |
-
- 1M<n<10M
|
| 13 |
-
---
|
| 14 |
-
|
| 15 |
-
# tiny_schiller
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
*"Das Leben ist
|
| 20 |
-
|
| 21 |
-

|
| 22 |
-
|
| 23 |
-
##
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
```
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
```
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
Tested model targets: TinyLlama 1.1B, Phi-3 Mini 3.8B, Llama 3.2 1B/3B, Qwen2.5 0.5B–3B.
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
## Dramen und begleitende Schriften:
|
| 105 |
-
- Briefe über Don Carlos
|
| 106 |
-
- Aus dem Szenar zum »Demetrius«
|
| 107 |
-
- Demetrius
|
| 108 |
-
- Die Huldigung der Künste
|
| 109 |
-
- Die Jungfrau von Orleans
|
| 110 |
-
- Die Räuber
|
| 111 |
-
- Die Verschwörung des Fiesco zu Genua
|
| 112 |
-
- Don Carlos, Infant von Spanien
|
| 113 |
-
- Kabale und Liebe
|
| 114 |
-
- Maria Stuart
|
| 115 |
-
- Wallenstein
|
| 116 |
-
- Wilhelm Tell
|
| 117 |
-
|
| 118 |
-
## Citation
|
| 119 |
-
|
| 120 |
-
In conclusion, the works of Friedrich Schiller are a valuable contribution to literature, and this project aims to make them more accessible to language models. We hope you find this resource useful for your research and creative endeavors.
|
| 121 |
-
|
| 122 |
-
If you use this work in your research or projects, please cite it as follows:
|
| 123 |
-
|
| 124 |
-
```markdown
|
| 125 |
-
@misc{schutera2023tinyschiller,
|
| 126 |
-
author = {Schutera, Mark},
|
| 127 |
-
title = {tiny\_schiller: a small German Schiller corpus for tiny language models},
|
| 128 |
-
year = {2023},
|
| 129 |
-
howpublished = {\url{https://github.com/schutera/tiny_schiller}},
|
| 130 |
-
note = {Source texts: Projekt Gutenberg-DE, public domain.}
|
| 131 |
-
}
|
| 132 |
-
```
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- de
|
| 4 |
+
license:
|
| 5 |
+
- cc0-1.0
|
| 6 |
+
- mit
|
| 7 |
+
license_details: "Text content (Schiller's works) is public domain (CC0). Pipeline code is MIT licensed."
|
| 8 |
+
task_categories:
|
| 9 |
+
- text-generation
|
| 10 |
+
pretty_name: tiny_schiller
|
| 11 |
+
size_categories:
|
| 12 |
+
- 1M<n<10M
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# tiny_schiller
|
| 16 |
+
|
| 17 |
+
A small (~2 MB) German-language analogue to Karpathy's [tiny_shakespeare](https://huggingface.co/datasets/tiny_shakespeare) — 12 of Friedrich Schiller's dramatic works, cleaned and tokenised for tutorial-scale language models.
|
| 18 |
+
|
| 19 |
+
*"Das Leben ist nur ein Moment, der Tod ist auch nur einer."* — Friedrich Schiller
|
| 20 |
+
|
| 21 |
+

|
| 22 |
+
|
| 23 |
+
## Corpus
|
| 24 |
+
|
| 25 |
+
~2.2 MB · 12 works · 2,168,278 characters · sourced from [Projekt Gutenberg](https://www.projekt-gutenberg.org/autoren/namen/schiller.html)
|
| 26 |
+
|
| 27 |
+
| Tokenizer | Tokens | chars/token |
|
| 28 |
+
|---|---|---|
|
| 29 |
+
| character-level | 2,168,278 | 1.00 |
|
| 30 |
+
| GPT-2 BPE | 913,675 | 2.37 |
|
| 31 |
+
| `cl100k_base` | 681,548 | 3.18 |
|
| 32 |
+
|
| 33 |
+
Use **character-level** for teaching-scale models (96-token vocab, no tokenizer needed). Use **cl100k** over GPT-2 when sequence length matters — German umlauts and compounds tokenise 25% more efficiently.
|
| 34 |
+
|
| 35 |
+
## Works
|
| 36 |
+
|
| 37 |
+
- Die Räuber
|
| 38 |
+
- Die Verschwörung des Fiesco zu Genua
|
| 39 |
+
- Kabale und Liebe
|
| 40 |
+
- Don Carlos, Infant von Spanien
|
| 41 |
+
- Wallenstein (trilogy)
|
| 42 |
+
- Maria Stuart
|
| 43 |
+
- Die Jungfrau von Orleans
|
| 44 |
+
- Die Braut von Messina
|
| 45 |
+
- Wilhelm Tell
|
| 46 |
+
- Die Huldigung der Künste
|
| 47 |
+
- Briefe über Don Carlos
|
| 48 |
+
- Aus dem Szenar zum »Demetrius«
|
| 49 |
+
|
| 50 |
+
## Quick Start — nanoGPT
|
| 51 |
+
|
| 52 |
+
```bash
|
| 53 |
+
python schiller_char/prepare.py # char-level, 96-vocab
|
| 54 |
+
python schiller_bpe/prepare.py # GPT-2 BPE, 50k vocab
|
| 55 |
+
python schiller_cl100k/prepare.py # cl100k, 100k vocab
|
| 56 |
+
```
|
| 57 |
+
|
| 58 |
+
## HuggingFace Datasets
|
| 59 |
+
|
| 60 |
+
```python
|
| 61 |
+
from datasets import load_dataset
|
| 62 |
+
|
| 63 |
+
ds = load_dataset("mrkschtr/tiny_schiller")
|
| 64 |
+
print(ds["train"][0]["title"])
|
| 65 |
+
print(ds["train"][0]["text"][:200])
|
| 66 |
+
```
|
| 67 |
+
|
| 68 |
+
10 works in train, 2 in test (Wilhelm Tell, Die Braut von Messina). Each row is one complete work with `title` and `text` fields.
|
| 69 |
+
|
| 70 |
+
## Fine-tuning small LLMs
|
| 71 |
+
|
| 72 |
+
```bash
|
| 73 |
+
pip install transformers trl datasets accelerate
|
| 74 |
+
python examples/finetune_sft.py --model TinyLlama/TinyLlama-1.1B-Chat-v1.0
|
| 75 |
+
```
|
| 76 |
+
|
| 77 |
+
Default context window is 2048 tokens. Match your model with `--context_length`:
|
| 78 |
+
|
| 79 |
+
```bash
|
| 80 |
+
python examples/finetune_sft.py --model microsoft/Phi-3-mini-4k-instruct --context_length 4096
|
| 81 |
+
python examples/finetune_sft.py --model Qwen/Qwen2.5-0.5B --context_length 4096
|
| 82 |
+
```
|
| 83 |
+
|
| 84 |
+
Tested: TinyLlama 1.1B · Phi-3 Mini 3.8B · Llama 3.2 1B/3B · Qwen2.5 0.5B–3B.
|
| 85 |
+
|
| 86 |
+
## License
|
| 87 |
+
|
| 88 |
+
Text: public domain (Schiller died 1805). Pipeline code: MIT. See [LICENSING.md](LICENSING.md) for details.
|
| 89 |
+
|
| 90 |
+
## Citation
|
| 91 |
+
|
| 92 |
+
```bibtex
|
| 93 |
+
@misc{schutera2023tinyschiller,
|
| 94 |
+
author = {Schutera, Mark},
|
| 95 |
+
title = {tiny\_schiller: a small German Schiller corpus for tiny language models},
|
| 96 |
+
year = {2023},
|
| 97 |
+
howpublished = {\url{https://github.com/schutera/tiny_schiller}},
|
| 98 |
+
note = {Source texts: Projekt Gutenberg-DE, public domain.}
|
| 99 |
+
}
|
| 100 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data/test.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:df3a282947b6945634e8a59d219fdf462630f122b67b7b2dffb9e079bb5ed5dd
|
| 3 |
+
size 195490
|
data/train.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2ce07f28c9ef59634adc6fa066b604223bf83a7a551c3421716b671a02072c42
|
| 3 |
+
size 1171949
|