🚀 DeepHermes-3-Llama-3-3B-Preview-Abliterated
DeepHermes 3 Preview Abliterated 是 Nous Research 旗舰 Hermes 系列大语言模型(LLM)的最新版本,也是全球首批将推理(能提高答案准确性的长思维链)和普通大语言模型响应模式统一到一个模型中的模型之一。我们还改进了大语言模型的注释、判断和函数调用功能。DeepHermes 3 Preview Abliterated 是一个混合推理模型,也是首批将“直觉”传统模式响应和长思维链推理响应统一到单个模型中的大语言模型之一,可通过系统提示进行切换。
🚀 快速开始
环境准备
确保你已经安装了必要的库,如 torch
、transformers
和 flash_attn
。
代码示例
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
import flash_attn
import time
tokenizer = AutoTokenizer.from_pretrained("prithivMLmods/DeepHermes-3-Llama-3-3B-Preview-Abliterated")
model = AutoModelForCausalLM.from_pretrained(
"prithivMLmods/DeepHermes-3-Llama-3-3B-Preview-Abliterated",
torch_dtype=torch.float16,
device_map="auto",
attn_implementation="flash_attention_2",
)
messages = [
{
"role": "system",
"content": "You are a deep thinking AI, you may use extremely long chains of thought to deeply consider the problem and deliberate with yourself via systematic reasoning processes to help come to a correct solution prior to answering. You should enclose your thoughts and internal monologue inside <think> </think> tags, and then provide your solution or response to the problem."
},
{
"role": "user",
"content": "What is y if y=2*2-4+(3*2)"
}
]
input_ids = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors='pt').to("cuda")
generated_ids = model.generate(input_ids, max_new_tokens=2500, temperature=0.8, repetition_penalty=1.1, do_sample=True, eos_token_id=tokenizer.eos_token_id)
print(f"Generated Tokens: {generated_ids.shape[-1:]}")
response = tokenizer.decode(generated_ids[0], skip_special_tokens=True, clean_up_tokenization_space=True)
print(f"Response: {response}")
✨ 主要特性
- 模式统一:将推理和普通大语言模型响应模式统一到一个模型中,可通过系统提示切换。
- 功能改进:改进了大语言模型的注释、判断和函数调用功能。
- 混合推理:支持“直觉”传统模式响应和长思维链推理响应。
📚 详细文档
预期用途
DeepHermes-3-Llama-3-3B-Preview-Abliterated 旨在用于高级推理、问题解决和结构化思维生成。它无缝集成了直觉响应生成和深度思维链推理,非常适合需要逻辑演绎、复杂问题分析和人工智能辅助决策的任务。凭借改进的注释、判断和函数调用功能,该模型非常适合研究、自动化、编码辅助以及对准确性和可解释性要求较高的人工智能驱动的学术或专业应用。
📄 许可证
本项目采用 Apache-2.0 许可证。
属性 |
详情 |
模型类型 |
文本生成模型 |
基础模型 |
NousResearch/DeepHermes-3-Llama-3-3B-Preview |
许可证 |
Apache-2.0 |
语言 |
英文 |
任务类型 |
文本生成 |