Downloads · 30 days
4
8% of all-time downloads
csokosgeza/gpt-oss-20b-hun-4bit
gpt-oss-20b-hun-4bit is a machine learning model from csokosgeza. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft. The card lists the license as apache-2.0.
--- basemodel: unsloth/gpt-oss-20b libraryname: peft ---
Downloads · 30 days
4
8% of all-time downloads
All-time downloads
48
Public
Repo size
31.9 MB
Likes
0
Public
Click a slice to open those files.
.safetensors31.9 MB · 100%
From the Hugging Face model README
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.
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.
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:
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.
unsloth/gpt-oss-20bThis 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:
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.
unsloth/gpt-oss-20bEz 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:
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:
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.
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
)