Instructions to use hausmer/truha-gemma4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use hausmer/truha-gemma4 with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("google/gemma-4-e4b-it") model = PeftModel.from_pretrained(base_model, "hausmer/truha-gemma4") - Notebooks
- Google Colab
- Kaggle
Truha β Ukrainian news satire LoRA (Gemma 4 E4B)
A LoRA adapter (r=16, alpha=32) for google/gemma-4-E4B-it
that turns a seed topic into a short, meta-ironic satirical "news" item in
Ukrainian β the truha register: punchline-driven fake-news headlines with
a bitter aftertaste.
Trained (LoRA SFT) on a 46k-row Ukrainian corpus:
- 39,272 synthetic satirical news items and 1,722 Wikipedia-derived items
β fully public in
hausmer/truha-news-satire; - 5,145 short audience comments from the public satirical news channel Β«Π’ΡΡΡ Π°β‘οΈΠ£ΠΊΡΠ°ΡΠ½Π°Β» (comments were already public to the channel's subscribers). These carry no @handles or personal data, but because they are real user text they are not republished in the open dataset β so this model is not 100% reproducible from the public dataset alone.
Base model is Apache-2.0 licensed; this adapter is published under Apache-2.0 with attribution to Google DeepMind for the base model.
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base = "google/gemma-4-E4B-it"
adapter = "hausmer/truha-gemma4"
tok = AutoTokenizer.from_pretrained(adapter)
model = AutoModelForCausalLM.from_pretrained(
base, torch_dtype="bfloat16", device_map="cuda"
)
model = PeftModel.from_pretrained(model, adapter)
# NOTE: the trained system prompt is "Π’ΠΈ β TrueXAnΠ΅ws." β the last "Π΅"
# is CYRILLIC U+0435, not latin 'e'. The model was tuned on that exact
# string; using a pure-latin "TrueXAnΠ΅ws" with 'e' U+0065 may degrade style.
messages = [
{"role": "system", "content": "Π’ΠΈ β TrueXAnΠ΅ws."},
{"role": "user", "content": "ΠΡΠΎΠ±ΠΈ Π½ΠΎΠ²ΠΈΠ½Ρ Π² ΡΡΠΈΠ»Ρ ΡΡΡΡ
ΠΈ: <ΡΠΎΠΏΠΈΠΊ>"},
]
prompt = tok.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)
inputs = tok(prompt, return_tensors="pt").to(model.device)
# Style-tuned sampling
out = model.generate(
**inputs,
do_sample=True, temperature=0.95, top_p=0.92,
repetition_penalty=1.05, max_new_tokens=160,
)
print(tok.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
Example
prompt:
ΠΡΠΎΠ±ΠΈ Π½ΠΎΠ²ΠΈΠ½Ρ Π² ΡΡΠΈΠ»Ρ ΡΡΡΡ ΠΈ: Π·Π°ΡΡΠΊΡΠΎΠ²Π°Π½ΠΎ ΡΠ΄Π°Ρ Π±ΠΏΠ»Π° ΠΏΠΎoutput: π΄ ΠΠΠ€ΠΠΠ‘ΠΠΠΠΠ ΡΠ΄Π°Ρ ΠΠΠΠ ΠΏΠΎ ΡΠ΅ΠΊΠ»Π°ΠΌΠ½ΠΎΠΌΡ ΡΠΈΡΡ Β«ΠΡΠΏΡΠΉ ΠΊΠ²Π°ΡΡΠΈΡΡ Π² ΡΠΏΠΎΡΠ΅ΠΊΡΒ». Π Π΅ΠΊΠ»Π°ΠΌΠ° Π±ΡΠ΅Ρ Π°Π»Π° β ΡΠ΅ΠΏΠ΅Ρ ΠΏΡΠ°Π²Π΄Π°.
Training
- Base:
google/gemma-4-E4B-it(256K context, multimodal) - PEFT 0.20 LoRA: r=16, alpha=32, dropout 0.05, target modules = all
attention/MLP projections of the language model
(
q/k/v/o/gate/up/down_proj), 3 epochs, bf16 - Data: 46,139 rows β 39,272 synthetic
truha_satire+ 1,722general_ua(public, in the open dataset) + 5,145 public-audience comment rows (not republished) - Val: 2,066 held-out synthetic news items; eval loss β 1.31
License
Apache-2.0. Weights derive from Google's Gemma 4 (Apache-2.0); attribution required per the base model license. Satirical content is fictional; the model writes parody, not journalism.
- Downloads last month
- 7