Text Generation
Transformers
Safetensors
Polish
gpt2
polish
base-model
from-scratch
text-generation-inference
Instructions to use SlayerLab/GoLLeM-110M-PL-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SlayerLab/GoLLeM-110M-PL-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="SlayerLab/GoLLeM-110M-PL-v2")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("SlayerLab/GoLLeM-110M-PL-v2") model = AutoModelForCausalLM.from_pretrained("SlayerLab/GoLLeM-110M-PL-v2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use SlayerLab/GoLLeM-110M-PL-v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SlayerLab/GoLLeM-110M-PL-v2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SlayerLab/GoLLeM-110M-PL-v2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/SlayerLab/GoLLeM-110M-PL-v2
- SGLang
How to use SlayerLab/GoLLeM-110M-PL-v2 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 "SlayerLab/GoLLeM-110M-PL-v2" \ --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": "SlayerLab/GoLLeM-110M-PL-v2", "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 "SlayerLab/GoLLeM-110M-PL-v2" \ --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": "SlayerLab/GoLLeM-110M-PL-v2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use SlayerLab/GoLLeM-110M-PL-v2 with Docker Model Runner:
docker model run hf.co/SlayerLab/GoLLeM-110M-PL-v2
GoLLeM-110M-PL-v2: clean multi-source 2B (58/42), CC-BY-SA-4.0 + attribution
Browse files- README.md +61 -0
- config.json +32 -0
- generation_config.json +6 -0
- model.safetensors +3 -0
- tokenizer.json +0 -0
- tokenizer_config.json +1 -0
README.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: cc-by-sa-4.0
|
| 3 |
+
language:
|
| 4 |
+
- pl
|
| 5 |
+
library_name: transformers
|
| 6 |
+
pipeline_tag: text-generation
|
| 7 |
+
tags:
|
| 8 |
+
- gpt2
|
| 9 |
+
- polish
|
| 10 |
+
- base-model
|
| 11 |
+
- from-scratch
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
# GoLLeM-110M-PL-v2
|
| 15 |
+
|
| 16 |
+
Polski model językowy **110M** (GPT-2-class), trenowany **od zera** na AMD Radeon RX 7900 XTX (ROCm/WSL2). Model **bazowy (completion)** — kontynuuje tekst, **nie jest chatbotem** (nie odpowiada na pytania; daj mu początek zdania).
|
| 17 |
+
|
| 18 |
+
Druga iteracja serii GoLLeM. Główna zmiana vs v1: **czysty, wielo-źródłowy korpus** (dodane wiedza+literatura) → lepsze fakty i forma, zero web-boilerplate.
|
| 19 |
+
|
| 20 |
+
## Trening
|
| 21 |
+
- **Architektura:** 12 warstw / 12 głowic / d=768, kontekst 512, vocab 32000, weight-tied (110M param).
|
| 22 |
+
- **Dane:** ~2.0B tokenów, 1 epoka, **czysty multi-source**:
|
| 23 |
+
- **58% curated** (wiedza+literatura): Wikipedia, Wikisource, Wolne Lektury, 1000 Novels, Wikiquote/Wikibooks/Wikinews/Wikivoyage, eltec.
|
| 24 |
+
- **42% web** (HPLT v3 pol, po czyszczeniu).
|
| 25 |
+
- **Zero legalese** (świadomie wykluczone eur-lex/parlament, by nie zdominowały rejestru).
|
| 26 |
+
- **Higiena:** otwarte licencje (CC-BY-SA dominują — patrz sekcja Licencja; HPLT web = CC0), PII-scrubowane (telefon/email/PESEL/NIP → tagi), web-boilerplate usunięty u źródła (span+line strip; emisja boilerplate ~0).
|
| 27 |
+
- **Sprzęt:** 1× AMD 7900 XTX (24GB), ROCm/WSL2, bf16, grad-accum, ~8.3h.
|
| 28 |
+
|
| 29 |
+
## vs v1 (GoLLeM-110M-PL)
|
| 30 |
+
- **Lepsze fakty/forma** (dodany korpus wiedzy: encyklopedyczny/przepisowy rejestr; v1 był web-only).
|
| 31 |
+
- **Zero emisji web-boilerplate** (v1 emitował śmieci typu "OdpowiedzUsuń").
|
| 32 |
+
- **val-ppl 34.6** (held-out).
|
| 33 |
+
|
| 34 |
+
## Użycie
|
| 35 |
+
```python
|
| 36 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 37 |
+
m = AutoModelForCausalLM.from_pretrained("Maggio33/GoLLeM-110M-PL-v2")
|
| 38 |
+
t = AutoTokenizer.from_pretrained("Maggio33/GoLLeM-110M-PL-v2")
|
| 39 |
+
ids = t("Stolicą Polski jest miasto", return_tensors="pt").input_ids
|
| 40 |
+
print(t.decode(m.generate(ids, max_new_tokens=80, do_sample=True, temperature=0.7, repetition_penalty=1.3)[0]))
|
| 41 |
+
```
|
| 42 |
+
**Tip:** to model bazowy — dawaj POCZĄTEK zdania ("Przepis na rosół:", "Warszawa to"), nie pytania.
|
| 43 |
+
|
| 44 |
+
## Ograniczenia
|
| 45 |
+
- **110M = mały** → konfabuluje konkretne fakty (nie jest bazą wiedzy). Uczy się głównie płynności i formy polskiego.
|
| 46 |
+
- **Base/completion, nie chat** — nie odpowiada na pytania (do tego potrzebny SFT/instruct-tuning).
|
| 47 |
+
- PII scrubowane w treningu → model zwraca tagi zamiast realnych danych; nie jest źródłem PII.
|
| 48 |
+
- Tylko polski.
|
| 49 |
+
|
| 50 |
+
## Licencja i atrybucja
|
| 51 |
+
**Korpus = CC-BY-SA-4.0** (licencja dominująca, share-alike). Skład per-źródło:
|
| 52 |
+
- Wikipedia, Wikisource, Wikibooks/Wikiquote/Wikinews/Wikivoyage — **CC-BY-SA-3.0** (Wikimedia Foundation)
|
| 53 |
+
- Wolne Lektury — **CC-BY-SA-4.0 / Wolna Sztuka 1.3**
|
| 54 |
+
- 1000 Novels, eltec_pol — **CC-BY-4.0**
|
| 55 |
+
- HPLT v3 (web, ~42%) — **CC0-1.0**
|
| 56 |
+
|
| 57 |
+
→ Użycie wymaga **ATTRIBUTION** (Wikimedia Foundation, Wolne Lektury, autorzy 1000 Novels, HPLT / CLARIN-PL) oraz **SHARE-ALIKE** (derywaty na licencji CC-BY-SA-kompatybilnej).
|
| 58 |
+
|
| 59 |
+
**Model:** CC-BY-SA-4.0 (share-alike, spójny z licencją korpusu).
|
| 60 |
+
|
| 61 |
+
**Autor:** Arkadiusz Słota.
|
config.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"activation_function": "gelu",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"GPT2LMHeadModel"
|
| 5 |
+
],
|
| 6 |
+
"attn_pdrop": 0.0,
|
| 7 |
+
"bos_token_id": 0,
|
| 8 |
+
"embd_pdrop": 0.0,
|
| 9 |
+
"eos_token_id": 0,
|
| 10 |
+
"initializer_range": 0.02,
|
| 11 |
+
"layer_norm_epsilon": 1e-05,
|
| 12 |
+
"model_type": "gpt2",
|
| 13 |
+
"n_ctx": 512,
|
| 14 |
+
"n_embd": 768,
|
| 15 |
+
"n_head": 12,
|
| 16 |
+
"n_inner": null,
|
| 17 |
+
"n_layer": 12,
|
| 18 |
+
"n_positions": 512,
|
| 19 |
+
"reorder_and_upcast_attn": false,
|
| 20 |
+
"resid_pdrop": 0.0,
|
| 21 |
+
"scale_attn_by_inverse_layer_idx": false,
|
| 22 |
+
"scale_attn_weights": true,
|
| 23 |
+
"summary_activation": null,
|
| 24 |
+
"summary_first_dropout": 0.1,
|
| 25 |
+
"summary_proj_to_labels": true,
|
| 26 |
+
"summary_type": "cls_index",
|
| 27 |
+
"summary_use_proj": true,
|
| 28 |
+
"torch_dtype": "float32",
|
| 29 |
+
"transformers_version": "4.46.3",
|
| 30 |
+
"use_cache": true,
|
| 31 |
+
"vocab_size": 32000
|
| 32 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 0,
|
| 4 |
+
"eos_token_id": 0,
|
| 5 |
+
"transformers_version": "4.46.3"
|
| 6 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3d8937c530d80aab863d4fee924ca8871bc22a345a6cb0be9f258dca32b96eac
|
| 3 |
+
size 440115840
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"tokenizer_class":"PreTrainedTokenizerFast","bos_token":"<|endoftext|>","eos_token":"<|endoftext|>","unk_token":"<|endoftext|>"}
|