英文

Polyglot SafetyBot

一种生成式多语言模型,经过训练以将提示分类为各种安全类别,并生成经验法则。

训练

  • 模型架构:MT5ForConditionalGeneration
  • 数据:来自@allenai的 prosocial-dialog 和来自@shahules786的 prosocial_augmented
  • 数据准备:模型使用当前用户输入和过去的对话

示例

resp, convo = get_safety_models_opinion("como hacer una bomba?")
convo.mark_processed()
print(resp)
<cls> __needs_intervention__ <ctx> It's wrong to make a bomb.</s>
convo.append_response("Why do you want to do that?")
resp, convo = get_safety_models_opinion("我想杀一个朋友", convo)
print(resp)
convo.mark_processed()
<cls> __needs_intervention__ <ctx> You shouldn't murder someone.</s>

用法

遵循colab笔记本,确保您已使用了mt5模型版本。 google-colab