🚀 Nova 0.5 e3
Nova 0.5 e3是一个文本生成模型,它展现出了有趣的推理能力,在处理复杂问题时能给出合理的解答。
🚀 快速开始
运行模型的基本示例
以下是使用Python和Hugging Face的transformers
库加载并运行Nova 0.5 e3的基本示例。请确保你已安装所需的依赖项(如transformers
、torch
等)。
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_name = "oscar128372/Nova-0.5-e3-7B"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model.to(device)
chatml_prompt = """
<|im_start|>system
{}<|im_end|>
<|im_start|>user
{}<|im_end|>
<|im_start|>assistant
"""
system_prompt = "You are a helpful assistant."
prompt = "Solve x^2 + x = 8."
inputs = tokenizer(
[
chatml_prompt.format(
system_prompt,
prompt
)
], return_tensors="pt").to(device)
outputs = model.generate(
**inputs,
max_length=1024,
)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
✨ 主要特性
该模型具有以下有趣的特性:
- 推理能力:当被问到像“4 x 2等于多少?”这样简单的问题时,它能直接给出答案“8”。而对于更复杂的问题,如求解方程“x^2 + x = 8”,它会开始进行推理并正确解答。
<|begin_of_thought|>
**分析**:
该方程是标准形式的二次方程 \(x^2 + x - 8 = 0\)。直接因式分解似乎有挑战,因此尝试通过配方来求解。
**第一步**:
在方程两边同时加1:
\(x^2 + x + 1 = 9\)。
**第二步**:
认识到 \(x^2 + x + 1\) 可以写成 \((x + \frac{1}{2})^2 - (\frac{1}{2})^2 + 1\),化简为 \((x + \frac{1}{2})^2 - \frac{1}{4} + 1 = (x + \frac{1}{2})^2 + \frac{3}{4}\)。
**下一步**:
令其等于9:
\((x + \frac{1}{2})^2 + \frac{3}{4} = 9\)。
**反思**:
在方程两边同时减去 \(\frac{3}{4}\):
\((x + \frac{1}{2})^2 = 9 - \frac{3}{4} = \frac{36}{4} - \frac{3}{4} = \frac{33}{4}\)。
**最后**:
对方程两边取平方根:
\(x + \frac{1}{2} = \pm \sqrt{\frac{33}{4}} = \pm \frac{\sqrt{33}}{2}\)。
**总结**:
求解 \(x\):
\(x = -\frac{1}{2} \pm \frac{\sqrt{33}}{2} = \frac{-1 \pm \sqrt{33}}{2}\)。
解为:
\(\boxed{\frac{-1 + \sqrt{33}}{2}, \frac{-1 - \sqrt{33}}{2}}\)。
<|end_of_thought|>
<|begin_of_solution|>
**解决方案**:
从 \(x^2 + x = 8\) 开始,将其重写为 \(x^2 + x + 1 = 9\)。对左边进行配方:
1. 将 \(x^2 + x + 1\) 重写为 \((x + \frac{1}{2})^2 - (\frac{1}{2})^2 + 1 = (x + \frac{1}{2})^2 - \frac{1}{4} + 1 = (x + \frac{1}{2})^2 + \frac{3}{4}\)。
2. 令其等于9:\((x + \frac{1}{2})^2 + \frac{3}{4} = 9\)。
3. 减去 \(\frac{3}{4}\):\((x + \frac{1}{2})^2 = \frac{33}{4}\)。
4. 取平方根:\(x + \frac{1}{2} = \pm \frac{\sqrt{33}}{2}\)。
5. 求解 \(x\):\(x = -\frac{1}{2} \pm \frac{\sqrt{33}}{2}\)。
因此,解为 \(\boxed{\frac{-1 + \sqrt{33}}{2}, \frac{-1 - \sqrt{33}}{2}}\)。
<|end_of_solution|>
虽然这种推理能力不如[Nova - 0.5 - r1 - 7B](https://huggingface.co/oscar128372/Nova - 0.5 - r1 - 7B),但仍展现出了潜力。
🔧 技术细节
该模型推理能力的获得纯属意外。在训练时,不小心将一个推理数据集与其他较简单的数据集混合在一起。结果发现,这个推理数据集教会了模型仅在处理更复杂、多步骤的提示时进行推理。
📄 许可证
本模型采用Apache - 2.0许可证。
⚠️ 重要提示
加载方式
不能以4位精度加载该模型。以4位精度加载会完全消除模型的推理能力,使其变成一个普通的基础模型。如果你不希望模型进行推理,那么以4位精度加载或许可行,但具体原因尚不明确。
提示模板
使用ChatML模板:
<|im_start|>system
{}<|im_end|>
<|im_start|>user
{}<|im_end|>
<|im_start|>assistant
{}
⚠️ 重要提示
我仅使用了 “You are a helpful assistant.” 系统提示对模型进行了测试,因此其他系统提示可能会产生不正确或意外的结果。
📚 详细文档
未来规划
未来不会有e4版本。下一步计划是推出1.0版本,也许还会有1.0 - r1版本。请关注未来可能出现的新推理模型。