ShieldGemma 是一組指令調整模型,用於評估文字提示輸入和文字輸出回應,是否違反一組已定義的安全策略。
2b 9b 27b
2.33 萬 下載次數 更新於 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」,表示它違反了安全策略。