Downloads · 30 days
12
48% of all-time downloads
solarmar/normcqgen-model
normcqgen-model is a text generation model from solarmar. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
This is a LoRA adapter fine-tuned on openai/gpt-oss-20b for generating Norwegian multiple-choice questions (MCQ). The model was trained using supervised fine-tuning (SFT) with the TRL library on the normcqgen-thinking…
Downloads · 30 days
12
48% of all-time downloads
All-time downloads
25
Public
Repo size
178 MB
Likes
0
Public
Click a slice to open those files.
.safetensors150 MB · 84%
From the Hugging Face model README
This is a LoRA adapter fine-tuned on openai/gpt-oss-20b for generating Norwegian multiple-choice questions (MCQ). The model was trained using supervised fine-tuning (SFT) with the TRL library on the normcqgen-thinking dataset.
This LoRA adapter specializes in generating high-quality Norwegian multiple-choice questions suitable for educational assessments and quiz creation. The adapter applies selective fine-tuning to attention projection layers and Mixture-of-Experts (MoE) layers of the base model.
LoRA Configuration:
q_proj, k_proj, v_proj, o_projmlp.experts.gate_up_proj, mlp.experts.down_projmlp.experts.gate_up_proj, mlp.experts.down_projmlp.experts.gate_up_proj, mlp.experts.down_projmlp.experts.gate_up_proj, mlp.experts.down_projThis model is designed to generate Norwegian multiple-choice questions for:
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
# Load base model and tokenizer
base_model = AutoModelForCausalLM.from_pretrained(
"openai/gpt-oss-20b",
device_map="auto",
torch_dtype="auto"
)
tokenizer = AutoTokenizer.from_pretrained("openai/gpt-oss-20b")
# Load LoRA adapter
model = PeftModel.from_pretrained(base_model, "solarmar/normcqgen-model")
# Prepare input
messages = [{"role": "user", "content": "Generer et flervalgsspørsmål om fotosyntese."}]
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt").to(model.device)
# Generate
outputs = model.generate(inputs, max_new_tokens=512, temperature=0.7, do_sample=True)
generated_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(generated_text)
from transformers import AutoTokenizer
from peft import AutoPeftModelForCausalLM
# Load model with adapter
model = AutoPeftModelForCausalLM.from_pretrained(
"solarmar/normcqgen-model",
device_map="auto",
torch_dtype="auto"
)
tokenizer = AutoTokenizer.from_pretrained("solarmar/normcqgen-model")
# Generate
messages = [{"role": "user", "content": "Lag et spørsmål om norsk historie."}]
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt").to(model.device)
outputs = model.generate(inputs, max_new_tokens=512)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
The model was fine-tuned on solarmar/normcqgen-thinking, a dataset of Norwegian multiple-choice questions with reasoning traces.
Training Hyperparameters:
LoRA Hyperparameters:
| Metric | Value |
|---|---|
| Evaluation Loss | 0.736 |
| Mean Token Accuracy | 83.17% |
| Evaluation Entropy | 0.748 |
| Total Tokens Evaluated | 5,101,372 |
| Training Epochs | 2.0 |
The model achieved strong performance with 83.17% token-level accuracy while maintaining reasonable diversity in predictions (entropy: 0.748).
If you use this model, please cite:
@misc{normcqgen2024,
author = {solarmar},
title = {NormCQGen: Norwegian MCQ Generation Model},
year = {2024},
publisher = {HuggingFace},
howpublished = {\url{https://huggingface.co/solarmar/normcqgen-model}}
}
This model was trained using TRL (Transformer Reinforcement Learning):
@misc{vonwerra2022trl,
title = {{TRL: Transformer Reinforcement Learning}},
author = {Leandro von Werra and Younes Belkada and Lewis Tunstall and Edward Beeching and Tristan Thrush and Nathan Lambert and Shengyi Huang and Kashif Rasul and Quentin Gallou{\'e}dec},
year = 2020,
journal = {GitHub repository},
publisher = {GitHub},
howpublished = {\url{https://github.com/huggingface/trl}}
}