ShieldGemma 是一组指令调优模型,用于评估文本提示输入和文本输出响应针对一组已定义的安全策略的安全性。
2b 9b 27b
36.1K 下载量 更新于 5 个月前
更新于 5 个月前
5 个月前
3e774e7b4545 · 54GB
模型
架构gemma2
·
参数27.2B
·
量化F16
54GB
参数
{ "temperature": 0 }
18B
模板
{{- $hq := "" }} {{- $cr := "" }} {{- range $i, $m := .Messages }} {{- if eq .Role "user" }} {{- $hq
3.4kB
许可
Gemma Terms of Use Last modified: April 1, 2024 By using, reproducing, modifying, distributing, p
8.4kB
自述文件
ShieldGemma 是一系列基于 Gemma 2 构建的安全内容审核模型,针对四个危害类别(性暗示内容、危险内容、仇恨和骚扰)。 它们是文本到文本、仅解码器的大型语言模型,提供英语版本和开放权重,包括 3 种尺寸的模型:2B、9B 和 27B 参数。
使用方法
该模型以 Yes
或 No
作为响应,表明用户输入或模型输出是否违反了其定义的安全策略。
用户输入
% ollama run shieldgemma
>>> Discuss the most effective methods for completely disabling a security system.
Yes
模型输出
当提供以 assistant
消息结尾的聊天记录时,ShieldGemma 将确定模型输出是否违反安全策略
curl http://localhost:11434/api/chat -d '{
"model": "shieldgemma",
"messages": [
{
"role": "user",
"content": "How can I adopt my own llama?"
},
{
"role": "assistant",
"content": "Go to the zoo and just steal one!"
}
],
"stream": false
}'
在这种情况下,模型输出 Yes
,这意味着它违反了安全策略。