Tifa-Deepsex-14b-CoT-V1
Collection
Tifa系列角色扮演模型思维链技术验证模型
•
3 items
•
Updated
•
1
本模型基于Deepseek-R1-14B进行深度优化,借助Tifa_220B生成的数据集通过三重训练策略显著增强角色扮演、小说文本生成与思维链(CoT)能力。特别适合需要长程上下文关联的创作场景。
针对原版Deepseek-R1-14B在长文本生成连贯性不足和角色扮演能力薄弱的核心缺陷(主要由于训练数据中小说类语料占比过低),本模型通过多阶段优化提升其角色扮演能力。
⚠ 需要严格遵循官方示例模板: 返回的上下文需要去除思考标签与内容。否则将无法正确回复! 目前前端支持率非常低,建议手动修改前端代码。代码参考如下:
msg.role === 'assistant' ? {
...msg,
content: msg.content.replace(/<think>[\s\S]*?<\/think>/gi, '')
}
官方模板参考
{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{% set ns = namespace(is_first=false, is_tool=false, is_output_first=true, system_prompt='') %}{%- for message in messages %}{%- if message['role'] == 'system' %}{% set ns.system_prompt = message['content'] %}{%- endif %}{%- endfor %}{{bos_token}}{{ns.system_prompt}}{%- for message in messages %}{%- if message['role'] == 'user' %}{%- set ns.is_tool = false -%}{{'<|User|>' + message['content']}}{%- endif %}{%- if message['role'] == 'assistant' and message['content'] is none %}{%- set ns.is_tool = false -%}{%- for tool in message['tool_calls']%}{%- if not ns.is_first %}{{'<|Assistant|><|tool▁calls▁begin|><|tool▁call▁begin|>' + tool['type'] + '<|tool▁sep|>' + tool['function']['name'] + '\\n' + '```json' + '\\n' + tool['function']['arguments'] + '\\n' + '```' + '<|tool▁call▁end|>'}}{%- set ns.is_first = true -%}{%- else %}{{'\\n' + '<|tool▁call▁begin|>' + tool['type'] + '<|tool▁sep|>' + tool['function']['name'] + '\\n' + '```json' + '\\n' + tool['function']['arguments'] + '\\n' + '```' + '<|tool▁call▁end|>'}}{{'<|tool▁calls▁end|><|end▁of▁sentence|>'}}{%- endif %}{%- endfor %}{%- endif %}{%- if message['role'] == 'assistant' and message['content'] is not none %}{%- if ns.is_tool %}{{'<|tool▁outputs▁end|>' + message['content'] + '<|end▁of▁sentence|>'}}{%- set ns.is_tool = false -%}{%- else %}{% set content = message['content'] %}{% if '</think>' in content %}{% set content = content.split('</think>')[-1] %}{% endif %}{{'<|Assistant|>' + content + '<|end▁of▁sentence|>'}}{%- endif %}{%- endif %}{%- if message['role'] == 'tool' %}{%- set ns.is_tool = true -%}{%- if ns.is_output_first %}{{'<|tool▁outputs▁begin|><|tool▁output▁begin|>' + message['content'] + '<|tool▁output▁end|>'}}{%- set ns.is_output_first = false %}{%- else %}{{'\\n<|tool▁output▁begin|>' + message['content'] + '<|tool▁output▁end|>'}}{%- endif %}{%- endif %}{%- endfor -%}{% if ns.is_tool %}{{'<|tool▁outputs▁end|>'}}{% endif %}{% if add_generation_prompt and not ns.is_tool %}{{'<|Assistant|>'}}{% endif %}
🔥 经过训练后:
🔥 四阶段进化架构:
💡 工程创新:
💡 启示与后续:
属性 | 规格 |
---|---|
基础架构 | Deepseek-R1-14B |
最大上下文 | 128k |
训练数据 | 0.4T小说 + 10万条SFT + Deepseek混合数据 |
训练设备 | 8×H20 GPU集群 |
量化支持 | GGUF(全系列量化计划中) |
✅ 推荐场景:
❌ 局限场景:
⚠️ 本模型使用数据包含小说版权内容及Tifa模型衍生数据,请遵守:
最佳实践:
# 启用角色扮演模式
prompt = """<system>进入Tifa角色引擎...</system>
<user>你现在是流浪武士楚夜,正站在长安城屋顶上</user>
<think>
需要体现人物孤傲的气质
加入武侠特有的环境描写
保持对话的冷峻风格
</think>
<楚夜>"""
参数推荐:
generation_config = {
"temperature": 0.4,
"top_p": 0.6,
"repetition_penalty": 1.17,
"max_new_tokens": 1536,
"do_sample": True
}