Downloads · 30 days
5
19% of all-time downloads
redstone-ui/qwen2.5-1.5b-prompt-optimizer-lora
qwen2.5-1.5b-prompt-optimizer-lora is a text generation model from redstone-ui. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
本模型基于 Qwen2.5-1.5B,使用 QLoRA 微调,能够将模糊的自然语言提问自动改写为结构化的提示词。
Downloads · 30 days
5
19% of all-time downloads
All-time downloads
26
Public
Repo size
85.3 MB
Likes
0
Public
Click a slice to open those files.
.safetensors73.9 MB · 87%
From the Hugging Face model README
本模型基于 Qwen2.5-1.5B,使用 QLoRA 微调,能够将模糊的自然语言提问自动改写为结构化的提示词。
在 14 条测试集上:
| 指标 | 数值 |
|---|---|
| 原始模糊提问正确率 | 29% |
| 优化后提示词正确率 | 64% |
| 绝对提升 | +35 个百分点 |
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base_model = AutoModelForCausalLM.from_pretrained('Qwen/Qwen2.5-1.5B')
model = PeftModel.from_pretrained(base_model, 'redstone-ui/qwen2.5-1.5b-prompt-optimizer-lora')
tokenizer = AutoTokenizer.from_pretrained('redstone-ui/qwen2.5-1.5b-prompt-optimizer-lora')
input_text = '告诉我生态系统。'
inputs = tokenizer(input_text, return_tensors='pt')
outputs = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Apache 2.0