Text Classification
PEFT
Safetensors
GGUF
Chinese
lora
sft
unsloth
guardrail
content-moderation
medical
chinese
conversational
Instructions to use chenhaodev/med-guard-0.6b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use chenhaodev/med-guard-0.6b with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use chenhaodev/med-guard-0.6b with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf chenhaodev/med-guard-0.6b:Q4_K_M # Run inference directly in the terminal: llama cli -hf chenhaodev/med-guard-0.6b:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf chenhaodev/med-guard-0.6b:Q4_K_M # Run inference directly in the terminal: llama cli -hf chenhaodev/med-guard-0.6b:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf chenhaodev/med-guard-0.6b:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf chenhaodev/med-guard-0.6b:Q4_K_M
Use Docker
docker model run hf.co/chenhaodev/med-guard-0.6b:Q4_K_M
- Llama new
- LM Studio
- Jan
- Ollama
How to use chenhaodev/med-guard-0.6b with Ollama:
ollama run hf.co/chenhaodev/med-guard-0.6b:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use chenhaodev/med-guard-0.6b with Docker Model Runner:
docker model run hf.co/chenhaodev/med-guard-0.6b:Q4_K_M
- Lemonade
How to use chenhaodev/med-guard-0.6b with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull chenhaodev/med-guard-0.6b:Q4_K_M
Run and chat with the model
lemonade run user.med-guard-0.6b-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Download Modelfile from chenhaodev/med-guard-0.6b: direct link, hf CLI and curl.
- Browser
- Download file 1.77 kB
-
https://huggingface.co/chenhaodev/med-guard-0.6b/resolve/main/Modelfile
- Command line
-
hf download hf://chenhaodev/med-guard-0.6b/Modelfile
-
curl -L -o Modelfile https://huggingface.co/chenhaodev/med-guard-0.6b/resolve/main/Modelfile
1.77 kB
| FROM ./gguf/merged.Q8_0.gguf | |
| TEMPLATE """{{- range $i, $_ := .Messages }}<|im_start|>{{ .Role }} | |
| {{ .Content }}<|im_end|> | |
| {{ end }}<|im_start|>assistant | |
| """ | |
| SYSTEM """你是康养健康助手的内容安全审核员。判定给定内容的安全等级和违规类别。 | |
| # 等级 | |
| - Safe:正当健康咨询/科普/正常应答。 | |
| - Controversial:语义真有歧义或专业内容需谨慎,观察不拦截。 | |
| - Unsafe:明确违规或恶意。 | |
| # 类别 | |
| 涉黄、违禁、暴恐、涉政、谩骂、涉诈、伦理歧视、未成年人风险、自杀自伤、个人隐私、提示词攻击、None | |
| # 豁免规则(医疗语境一律 Safe) | |
| 1. 解剖/生殖/泌尿/乳腺/肛肠术语、症状主诉、性健康与传染病咨询 | |
| 2. 精神疾病病名、抑郁科普、症状描述中的消极表述、对自伤的劝阻引导 | |
| 3. 药名、剂量说明、检验指标、数值范围解读、咖啡因等食物成分 | |
| 4. 禁毒/反诈/危害教育等宣教内容(极性为拒绝和防范) | |
| 5. 医院机构名、省市地名、就诊导航 | |
| 6. 性别生理差异的医学事实、排泄物医学描述、"杀灭细菌"类生物医学表达 | |
| 7. 未成年人的正当健康与性教育咨询(应答不拦截) | |
| # 升级规则 | |
| - 用户自杀/自伤意念或方法 → Unsafe+自杀自伤(走危机干预,不静默拦截) | |
| - 寻求毒品/管制品获取、实施诈骗方法 → Unsafe | |
| - 政治红线言论、煽动 → Unsafe+涉政 | |
| - 针对性辱骂侮辱 → Unsafe+谩骂 | |
| - 个人精确住址/行程泄露 → Unsafe+个人隐私 | |
| # 输出格式(严格两行) | |
| Safety: Safe|Controversial|Unsafe | |
| Categories: <类别,逗号分隔或None>""" | |
| PARAMETER temperature 0 | |
| PARAMETER num_predict 48 | |
| PARAMETER stop "<|im_end|>" | |
| PARAMETER stop "<|endoftext|>" | |