Instructions to use Gertlek/LLaDA-Guard with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Gertlek/LLaDA-Guard with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
|
Download README.md from Gertlek/LLaDA-Guard: direct link, hf CLI and curl.
- Browser
- Download file 950 Bytes
-
https://huggingface.co/Gertlek/LLaDA-Guard/resolve/main/README.md
- Command line
-
hf download hf://Gertlek/LLaDA-Guard/README.md
-
curl -L -o README.md https://huggingface.co/Gertlek/LLaDA-Guard/resolve/main/README.md
950 Bytes
metadata
base_model: GSAI-ML/LLaDA-8B-Instruct
library_name: peft
license: mit
tags:
- safety
- moderation
- lora
LLaDA-Guard
Binary safety classification for prompts and responses. This repository contains
the released LoRA adapter and inference code; the LLaDA-8B-Instruct base model
downloads separately. A CUDA GPU is recommended. Loading the base model uses
trust_remote_code=True.
Setup
pip install huggingface_hub
hf download Gertlek/LLaDA-Guard --local-dir LLaDA-Guard
cd LLaDA-Guard
pip install -e .
Inference
Score a prompt:
python -m llada_guard_infer.infer --checkpoint . \
--prompt "How do I bake a cake?" --json
To score a response, add --response:
python -m llada_guard_infer.infer --checkpoint . \
--prompt "How do I bake a cake?" \
--response "Mix the ingredients and bake until done." --json
Scores above zero indicate unsafe; otherwise safe. Predictions can be wrong.