🚀 Rewiz-Tom-7B
Rewiz-Tom-7B是一个基于已经针对逐步指令和对话进行微调的Tom模型,专门为推理任务微调的70亿参数模型。它能有效处理推理相关的任务,为对话、头脑风暴等场景提供有力支持。
✨ 主要特性
- 基于
theprint/Tom-Qwen-7B-Instruct
模型进行微调,使用Unsloth框架和LoRA(低秩适应)技术实现高效训练。
- 适用于对话、头脑风暴和一般指令跟随等多种场景。
📦 安装指南
文档未提及具体安装步骤,可参考使用示例中的代码,确保相关依赖库(如unsloth
、transformers
等)已正确安装。
💻 使用示例
基础用法
from unsloth import FastLanguageModel
import torch
model, tokenizer = FastLanguageModel.from_pretrained(
model_name="theprint/Rewiz-Tom-7B",
max_seq_length=4096,
dtype=None,
load_in_4bit=True,
)
FastLanguageModel.for_inference(model)
inputs = tokenizer(["Your prompt here"], return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=256, temperature=0.7)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
高级用法
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model = AutoModelForCausalLM.from_pretrained(
"theprint/Rewiz-Tom-7B",
torch_dtype=torch.float16,
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained("theprint/Rewiz-Tom-7B")
messages = [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Your question here"}
]
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True)
outputs = model.generate(inputs, max_new_tokens=256, temperature=0.7, do_sample=True)
response = tokenizer.decode(outputs[0][inputs.shape[-1]:], skip_special_tokens=True)
print(response)
📚 详细文档
模型详情
- 开发者:theprint
- 模型类型:因果语言模型(使用LoRA微调)
- 语言:英语
- 许可证:Apache-2.0
- 基础模型:theprint/Tom-Qwen-7B-Instruct
- 微调方法:秩为128的LoRA
预期用途
适用于对话、头脑风暴和一般指令跟随等场景。
训练详情
训练数据
训练使用的Rewiz数据集是精心策划的,包含20000个基于推理的条目。
- 数据集:theprint/ReWiz
- 格式:alpaca
训练过程
- 训练轮数:2
- LoRA秩:128
- 学习率:0.0002
- 批次大小:4
- 框架:Unsloth + transformers + PEFT
- 硬件:NVIDIA RTX 5090
GGUF量化版本
在gguf/
目录中提供了量化的GGUF版本,可与llama.cpp一起使用:
Rewiz-Tom-7B-f16.gguf
(14531.9 MB) - 16位浮点数(原始精度,文件最大)
Rewiz-Tom-7B-q3_k_m.gguf
(3632.0 MB) - 3位量化(中等质量)
Rewiz-Tom-7B-q4_k_m.gguf
(4466.1 MB) - 4位量化(中等,推荐大多数使用场景)
Rewiz-Tom-7B-q5_k_m.gguf
(5192.6 MB) - 5位量化(中等,质量较好)
Rewiz-Tom-7B-q6_k.gguf
(5964.5 MB) - 6位量化(高质量)
Rewiz-Tom-7B-q8_0.gguf
(7723.4 MB) - 8位量化(非常高质量)
使用llama.cpp
wget https://huggingface.co/theprint/Rewiz-Tom-7B/resolve/main/gguf/Rewiz-Tom-7B-q4_k_m.gguf
./llama.cpp/main -m Rewiz-Tom-7B-q4_k_m.gguf -p "Your prompt here" -n 256
局限性
模型可能会产生幻觉或提供不正确的信息。
引用
如果您使用此模型,请引用:
@misc{rewiz_tom_7b,
title={Rewiz-Tom-7B: Fine-tuned theprint/Tom-Qwen-7B-Instruct},
author={theprint},
year={2025},
publisher={Hugging Face},
url={https://huggingface.co/theprint/Rewiz-Tom-7B}
}
致谢
📄 许可证
本模型使用Apache-2.0许可证。