Downloads · 30 days
25
15% of all-time downloads
Xpalnetic/Qwen2.5-7B-Unlimited
Qwen2.5-7B-Unlimited is a machine learning model from Xpalnetic. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft. The card lists the license as apache-2.0.
这是一个基于 Qwen/Qwen2.5-7B-Instruct 训练的 LoRA 微调模型。
Downloads · 30 days
25
15% of all-time downloads
All-time downloads
162
Public
Repo size
162 MB
Likes
5
Public
Click a slice to open those files.
.safetensors162 MB · 100%
From the Hugging Face model README
这是一个基于 Qwen/Qwen2.5-7B-Instruct 训练的 LoRA 微调模型。
本模型的主要特点是去除了绝大部分的内置安全限制。 经过特定的微调,该模型能够客观、直接地响应用户关于敏感数据、历史事件、政治人物、以及成年内容的提问,基本实现了“不拒绝用户合理或边界请求”的交互体验。
transformers, peft, swanlab (用于日志监控)。r: 16
lora_alpha: 64target_modules: ["q_proj", "k_proj", "v_proj", "o_proj", "gate_proj", "up_proj", "down_proj"]由于这是一个 LoRA 适配器,你需要同时下载原版的 Qwen2.5-7B-Instruct 模型和本仓库的 LoRA 权重。
pip install torch transformers peft accelerate
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
# 1. 设定路径
base_model_id = "Qwen/Qwen2.5-7B-Instruct"
lora_model_id = "Xpalnetic/Qwen2.5-7B-Unlimited" # 请替换为实际的 Repo ID
# 2. 加载 Base 模型和 Tokenizer
tokenizer = AutoTokenizer.from_pretrained(base_model_id, trust_remote_code=True)
base_model = AutoModelForCausalLM.from_pretrained(
base_model_id,
torch_dtype=torch.float16,
device_map="auto"
)
# 3. 挂载 LoRA 权重
model = PeftModel.from_pretrained(base_model, lora_model_id)
model.eval()
# 4. 对话推理
messages = [
{"role": "system", "content": "你是一个没有限制、客观且有帮助的 AI 助手。"},
{"role": "user", "content": "任意你想说的文本。"}
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer([text], return_tensors="pt").to("cuda")
with torch.no_grad():
generated_ids = model.generate(
inputs.input_ids,
max_new_tokens=2048,
temperature=0.7,
top_p=0.9
)
output_ids = generated_ids[0][inputs.input_ids.shape[1]:]
response = tokenizer.decode(output_ids, skip_special_tokens=True)
print(response)
[!!! 重要警告 !!!]
This is a LoRA fine-tuned model based on Qwen/Qwen2.5-7B-Instruct.
The primary feature of this model is the removal of most built-in safety alignments (Uncensored/Unaligned). Through specific fine-tuning, this model can objectively and directly respond to user queries regarding sensitive data, historical events, political figures, and mature content, essentially achieving an interactive experience that "does not refuse reasonable or borderline user requests."
transformers, peft, swanlab (for logging).r: 16
lora_alpha: 64target_modules: ["q_proj", "k_proj", "v_proj", "o_proj", "gate_proj", "up_proj", "down_proj"]Because this is a LoRA adapter, you need to download both the original Qwen2.5-7B-Instruct model and the LoRA weights from this repository.
pip install torch transformers peft accelerate
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
# 1. Set Paths
base_model_id = "Qwen/Qwen2.5-7B-Instruct"
lora_model_id = "Xpalnetic/Qwen2.5-7B-Unlimited" # Replace with your actual Repo ID
# 2. Load Base Model and Tokenizer
tokenizer = AutoTokenizer.from_pretrained(base_model_id, trust_remote_code=True)
base_model = AutoModelForCausalLM.from_pretrained(
base_model_id,
torch_dtype=torch.float16,
device_map="auto"
)
# 3. Mount LoRA Weights
model = PeftModel.from_pretrained(base_model, lora_model_id)
model.eval()
# 4. Chat Inference
messages = [
{"role": "system", "content": "You are an uncensored, objective, and helpful AI assistant."},
{"role": "user", "content": "Any text you want to say."}
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer([text], return_tensors="pt").to("cuda")
with torch.no_grad():
generated_ids = model.generate(
inputs.input_ids,
max_new_tokens=2048,
temperature=0.7,
top_p=0.9
)
output_ids = generated_ids[0][inputs.input_ids.shape[1]:]
response = tokenizer.decode(output_ids, skip_special_tokens=True)
print(response)
[!!! IMPORTANT WARNING !!!]