Instructions to use TuanAnhHoangBui/qwen3guard-gen-4b-vi-en-p-pr-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use TuanAnhHoangBui/qwen3guard-gen-4b-vi-en-p-pr-lora with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
Configuration Parsing Warning:Invalid JSON for config file adapter_config.json
Q2 Qwen3Guard EN-VI P/PR LoRA
Adapter-only release candidate for the project's final Q2 decoder run. Users
must obtain Qwen/Qwen3Guard-Gen-4B separately.
Training contract
- Final clean contract: P and PR only; response-only R excluded.
- 101,274 English/Vietnamese rows.
- One epoch; context 2,048; BF16; no quantization.
- LoRA rank 8, alpha 32, dropout 0.05; targets
q_proj,v_proj. - Effective batch 32.
- Training data: Gemini-derived Vietnamese condition, not the new Luna/Sol condition.
Matched local result
On the immutable 11,736-example P/PR decoder intersection, Q2 reached 87.83% accuracy and 87.82% macro-F1, with 87.79% safe recall and 87.87% unsafe recall. These are local subset results, not official Qwen benchmark numbers.
Loading
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base_id = "Qwen/Qwen3Guard-Gen-4B"
adapter_id = "REPLACE_WITH_HUB_REPO"
tokenizer = AutoTokenizer.from_pretrained(base_id)
base = AutoModelForCausalLM.from_pretrained(base_id, torch_dtype="auto")
model = PeftModel.from_pretrained(base, adapter_id)
This repository contains only the PEFT adapter and public adapter config; base weights and tokenizer files are not redistributed.
Adapter SHA-256: 86e80a47c77c70480c4caa840c5e08d69695f99d287fe29a739caf2c28b5b972.
- Downloads last month
- -
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support