ShieldGemma 是一系列指令微調模型,用於評估文字提示輸入和文字輸出回應,是否符合一系列定義的安全政策。
2b 9b 27b
23.3K 下載次數 更新於 3 months ago
讀我
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
,表示它違反了安全政策。