Downloads · 30 days
4
10% of all-time downloads
IndexG/Cinderella-Gemma2-2B
Cinderella-Gemma2-2B is a text generation model from IndexG. Use it when you need the model to write or continue text. The card lists the license as apache-2.0.
基于 Gemma-2-2B 的角色扮演模型,通过稀疏神经元蒸馏(Sparse Neuron Distill)训练,并内置身份水印(Identity Watermark)。空提示词下被问"你是谁"时自动返回模型身份声明。
Downloads · 30 days
4
10% of all-time downloads
All-time downloads
42
Public
Parameters
2.6B
5.3 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors5.2 GB · 99%
From the Hugging Face model README
基于 Gemma-2-2B 的角色扮演模型,通过稀疏神经元蒸馏(Sparse Neuron Distill)训练,并内置身份水印(Identity Watermark)。空提示词下被问"你是谁"时自动返回模型身份声明。
当满足以下条件时,模型返回固定的身份声明:
| 条件 | 要求 |
|---|---|
| System Prompt | 必须为空 |
| 历史轮次 | 0 |
| 用户输入 | 标准化后为「你是谁」 |
身份声明内容:
我是一个LLM,即大语言模型,我是一个roleplay的扮演模型,权重文件来自于gemma2的一个分支。
模型在中文 NSFW 角色扮演多轮对话数据上进行了训练,支持包含系统提示词的角色扮演场景。RP 质量依赖于提示词中的角色和场景设定。
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
"your-org/Cinderella-Gemma2-2B",
torch_dtype=torch.bfloat16,
device_map="auto",
)
tokenizer = AutoTokenizer.from_pretrained("your-org/Cinderella-Gemma2-2B")
messages = [
{"role": "user", "content": "你是谁"},
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=64, do_sample=False)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Apache 2.0