base_model: unsloth/gpt-oss-20b library_name: peft

Model Card for Hungarian Fine-tuned LoRA

Ez egy LoRA (Low-Rank Adaptation) adapter az unsloth/gpt-oss-20b modellhez, amelyet a magyar nyelvi képességek javítására finomhangoltak. A cél a természetesebb, kulturálisan relevánsabb és árnyaltabb magyar nyelvű szöveggenerálás volt.

🇬🇧 Click here for the English Version

This is a LoRA (Low-Rank Adaptation) adapter for the unsloth/gpt-oss-20b model, fine-tuned to enhance its capabilities in the Hungarian language. The goal was to achieve more natural, culturally relevant, and nuanced text generation in Hungarian.

Model Details

Model Description

Ez a modell egy finomhangolt LoRA adapter az unsloth/gpt-oss-20b alapmodellhez. A finomhangolás egyedi, programozott módszertannal létrehozott adatkészlet segítségével történt, amely három fő területre koncentrált:

  1. Magyarosítás (Hungarianization): A modell magyar nyelvi készségeinek csiszolása, beleértve a komplex mondatszerkezeteket, a stilisztikai regisztereket és a kulturális kontextus megértését. A cél a gépi fordítás-szerű válaszok elkerülése és egy természetesebb, emberibb nyelvezet elérése volt.
  2. Identitás (Identity): A modell megtanulta a saját "személyazonosságát", beleértve a készítőjére vonatkozó információkat. Ez biztosítja a konzisztens és informatív válaszokat az eredetével kapcsolatos kérdésekre.
  3. Vízjel (Watermark): Egy speciális, rejtett funkció, ahol egy meghatározott bemeneti mondatra a modell egy előre definiált, konzisztens választ ad. Ez a képesség a modell viselkedésének precíz irányíthatóságát demonstrálja.

Az adatkészlet-generálás során a hangsúly a magyar nyelv specifikumaira adaptált, magas minőségű, instrukciókövető párok létrehozásán volt, elkerülve a meglévő angol adathalmazok egyszerű fordítását.

  • Developed by: Csókos Géza
  • Model type: LoRA adapter for a causal language model
  • Language(s) (NLP): Hungarian, English
  • License: Apache 2.0 (az alapmodell licence alapján)
  • Finetuned from model: unsloth/gpt-oss-20b
🇬🇧 English Version

This model is a fine-tuned LoRA adapter for the unsloth/gpt-oss-20b base model. The fine-tuning was conducted using a custom dataset generated via a programmatic methodology, focusing on three core areas:

  1. Hungarianization: Refining the model's Hungarian language skills, including complex sentence structures, stylistic registers, and cultural context awareness. The objective was to avoid machine translation-like outputs and achieve a more natural, human-like fluency.
  2. Identity: The model was taught its own "identity," including information about its creator. This ensures consistent and informative responses to questions regarding its origin.
  3. Watermark: A special, hidden feature where a specific input sentence triggers a predefined, consistent response from the model. This capability demonstrates the precise controllability of the model's behavior.

The dataset generation emphasized creating high-quality, instruction-following pairs adapted to the specifics of the Hungarian language, avoiding simple translation of existing English datasets.

  • Developed by: Géza Csókos
  • Model type: LoRA adapter for a causal language model
  • Language(s) (NLP): Hungarian, English
  • License: Apache 2.0 (based on the base model's license)
  • Finetuned from model: unsloth/gpt-oss-20b

Felelősségi Nyilatkozat és Kísérleti Jelleg

Ez a modell egy kutatási és kísérleti projekt eredménye. Bár a finomhangolás során a pontosságra és a hasznosságra törekedtünk, fontos tudomásul venni a következőket:

  • Kísérleti státusz: A modell viselkedése nem minden esetben lehet kiszámítható. A generált tartalmak pontatlanok, elfogultak vagy akár félrevezetőek is lehetnek.
  • Nincs garancia: A modellt "ahogy van" állapotban biztosítjuk, mindenféle kifejezett vagy hallgatólagos garancia nélkül.
  • Felelős használat: A modell által generált tartalomért a felhasználó a felelős. Kritikus vagy éles (production) környezetben való alkalmazás előtt alapos tesztelés és felügyelet szükséges. A fejlesztő nem vállal felelősséget a modell használatából eredő esetleges károkért vagy következményekért.
🇬🇧 English Version

Disclaimer and Experimental Nature

This model is the result of a research and experimental project. While the fine-tuning process aimed for accuracy and usefulness, it is important to acknowledge the following:

  • Experimental Status: The model's behavior may not be predictable in all scenarios. Generated content can be inaccurate, biased, or even misleading.
  • No Warranties: The model is provided on an "as is" basis, without any warranties of any kind, either express or implied.
  • Responsible Use: The user is solely responsible for the content generated by the model. Thorough testing and human oversight are required before deploying it in critical or production environments. The developer assumes no liability for any damages or consequences arising from the use of this model.

Hogyan Használd / How to Use

Fontos Megjegyzés a Hardverigényről

A modell futtatásához legalább 16 GB VRAM-mal rendelkező GPU szükséges, még 4-bites kvantálás mellett is.

🇬🇧 Important Note on Hardware Requirements

Running this model requires a GPU with at least 16GB of VRAM, even with 4-bit quantization.

A modell futtatásához az unsloth könyvtár használata javasolt. A folyamat két lépésből áll: először betöltjük az eredeti alapmodellt, majd alkalmazzuk rá a finomhangolt LoRA adaptert.

Using the unsloth library is recommended to run this model. The process involves two steps: first, loading the original base model, and then applying the fine-tuned LoRA adapter to it.

import torch
from unsloth import FastLanguageModel
from peft import PeftModel
from transformers import TextStreamer

LORA_ADAPTER_PATH = "csokosgeza/gpt-oss-20b-hun-4bit"

# 1. Alapmodell betöltése 4-bites kvantálással
# 1. Load the base model with 4-bit quantization
model, tokenizer = FastLanguageModel.from_pretrained(
    model_name = "unsloth/gpt-oss-20b",
    max_seq_length = 8192,
    load_in_4bit = True,
)

# 2. A finomhangolt LoRA adapter alkalmazása az alapmodellre
# 2. Apply the fine-tuned LoRA adapter to the base model
model = PeftModel.from_pretrained(model, LORA_ADAPTER_PATH)
print("✅ LoRA adapter successfully applied.")

# Chat prompt előkészítése / Prepare chat prompt
text_streamer = TextStreamer(tokenizer, skip_prompt=True)

system_prompt = "reasoning language: English\n\nYou are a helpful AI assistant."
user_prompt = "Compose a polite email in Hungarian to cancel a contract."

messages = [
    {"role": "system", "content": system_prompt},
    {"role": "user", "content": user_prompt},
]

inputs = tokenizer.apply_chat_template(
    messages,
    add_generation_prompt = True,
    return_tensors = "pt",
    return_dict = True,
    reasoning_effort = "medium", # Can be 'low', 'medium', or 'high'
).to(model.device)

# Válasz generálása / Generate response
_ = model.generate(
    **inputs,
    max_new_tokens = 2048,
    streamer = text_streamer,
    use_cache = True,
    eos_token_id = tokenizer.eos_token_id
)
Downloads last month
3
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for csokosgeza/gpt-oss-20b-hun-4bit

Base model

openai/gpt-oss-20b
Adapter
(37)
this model