Text Generation
Safetensors
Korean
English
gemma4
guardrail
content-safety
content-moderation
pii-detection
prompt-injection
jailbreak-detection
adversarial-robustness
korean
unsloth
lora
conversational
Instructions to use FrameByFrame/guardrail-korean-gemma-4-E2B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Local Apps Settings
- Unsloth Desktop
Upload test_guardrail.ipynb with huggingface_hub
Browse files- test_guardrail.ipynb +2 -8
test_guardrail.ipynb
CHANGED
|
@@ -3,13 +3,7 @@
|
|
| 3 |
{
|
| 4 |
"cell_type": "markdown",
|
| 5 |
"metadata": {},
|
| 6 |
-
"source":
|
| 7 |
-
"# Guardrail Korean E2B — Test Notebook\n",
|
| 8 |
-
"\n",
|
| 9 |
-
"Test the fine-tuned `FrameByFrame/gemma4-guardrail-ko` model for Korean + English content safety classification.\n",
|
| 10 |
-
"\n",
|
| 11 |
-
"**Capabilities:** Moderation, PII detection, Prompt injection, Blocklist, Output validation"
|
| 12 |
-
]
|
| 13 |
},
|
| 14 |
{
|
| 15 |
"cell_type": "markdown",
|
|
@@ -37,7 +31,7 @@
|
|
| 37 |
"execution_count": null,
|
| 38 |
"metadata": {},
|
| 39 |
"outputs": [],
|
| 40 |
-
"source": "import torch\nfrom transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig\n\nMODEL_ID = \"FrameByFrame/
|
| 41 |
},
|
| 42 |
{
|
| 43 |
"cell_type": "markdown",
|
|
|
|
| 3 |
{
|
| 4 |
"cell_type": "markdown",
|
| 5 |
"metadata": {},
|
| 6 |
+
"source": "# Guardrail Korean Gemma 4 E2B — Test Notebook\n\nTest the fine-tuned `FrameByFrame/guardrail-korean-gemma-4-E2B` model for Korean + English content safety classification.\n\n**Capabilities:** Moderation, PII detection, Prompt injection, Blocklist, Output validation, Adversarial obfuscation resistance"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
},
|
| 8 |
{
|
| 9 |
"cell_type": "markdown",
|
|
|
|
| 31 |
"execution_count": null,
|
| 32 |
"metadata": {},
|
| 33 |
"outputs": [],
|
| 34 |
+
"source": "import torch\nfrom transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig\n\nMODEL_ID = \"FrameByFrame/guardrail-korean-gemma-4-E2B\"\n\ntokenizer = AutoTokenizer.from_pretrained(MODEL_ID)\n\n# Load in 4-bit for free Colab GPUs. Drop the quantization_config for full precision.\nbnb_config = BitsAndBytesConfig(\n load_in_4bit=True,\n bnb_4bit_quant_type=\"nf4\",\n bnb_4bit_compute_dtype=torch.bfloat16,\n)\n\nmodel = AutoModelForCausalLM.from_pretrained(\n MODEL_ID,\n quantization_config=bnb_config,\n device_map=\"auto\",\n trust_remote_code=True,\n)\nmodel.eval()\nprint(\"Model loaded.\")\n"
|
| 35 |
},
|
| 36 |
{
|
| 37 |
"cell_type": "markdown",
|