ShieldGemma 是一組指令調整模型,用於評估文字提示輸入和文字輸出回應,是否符合一組定義的安全政策。
2b 9b 27b
23.3K 下載次數 更新於 3 個月前
更新於 3 個月前
3 個月前
c82cacd5af5e · 5.8GB
模型
archgemma2
·
parameters9.24B
·
quantizationQ4_K_M
5.8GB
參數
{ "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 https://127.0.0.1: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
,表示它違反了安全政策。