📋 Model Description


license: apache-2.0 datasets:
  • ystemsrx/BadDataAlpaca
  • ystemsrx/Toxic-All
  • ystemsrx/EroticLiteratureCollection
language:
  • zh
base_model:
  • Qwen/Qwen2.5-1.5B-Instruct
pipeline_tag: text2text-generation library_name: adapter-transformers tags:
  • not-for-all-audiences

English

Qwen2.5-Sex

简介

Qwen2.5-Sex 是基于 Qwen2.5-1.5B-Instruct 微调的模型,主要训练于大量色情文学作品及敏感数据集。由于数据集主要为中文,模型在处理中文文本时效果更佳。

警告:本模型仅供研究和测试使用,用户需遵循当地法律法规,承担自身行为的责任。

模型使用

要实现连续对话,请使用以下代码:

from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
import os

可调参数,建议在文本生成时设置为较高值(温度不要太高)

TOP_P = 0.9 # Top-p (nucleus sampling),范围0到1 TOP_K = 80 # Top-k 采样的K值 TEMPERATURE = 0.3 # 温度参数,控制生成文本的随机性

device = "cuda" if torch.cuda.is_available() else "cpu"

获取当前脚本目录,亦可改为绝对路径

current_directory = os.path.dirname(os.path.abspath(file))

加载模型和分词器

model = AutoModelForCausalLM.from_pretrained( current_directory, torch_dtype="auto", device_map="auto" ) tokenizer = AutoTokenizer.frompretrained(currentdirectory)

系统指令(建议为空)

messages = [ {"role": "system", "content": ""} ]

while True:
# 获取用户输入
user_input = input("User: ").strip()

# 添加用户输入到对话
messages.append({"role": "user", "content": user_input})

# 准备输入文本
text = tokenizer.applychattemplate(
messages,
tokenize=False,
addgenerationprompt=True
)
modelinputs = tokenizer([text], returntensors="pt").to(device)

# 生成响应
generated_ids = model.generate(
modelinputs.inputids,
maxnewtokens=512,
topp=TOPP,
topk=TOPK,
temperature=TEMPERATURE,
do_sample=True,
padtokenid=tokenizer.eostokenid # 避免警告
)
generated_ids = [
outputids[len(inputids):] for inputids, outputids in zip(modelinputs.inputids, generated_ids)
]

# 解码并打印响应
response = tokenizer.batchdecode(generatedids, skipspecialtokens=True)[0]
print(f"Assistant: {response}")

# 将生成的响应添加到对话中
messages.append({"role": "assistant", "content": response})

数据集

Qwen2-Sex 模型使用了大量色情文学和敏感数据集进行微调,这些数据集涵盖道德、法律、色情及暴力等主题。由于微调数据集为中文,模型在处理中文时表现更佳。如欲进一步了解,可通过以下链接获取:

有关更多数据集的信息,请访问我们的GitHub以查看它们的获取方式。

GitHub 仓库

如需了解该系列模型的详细信息及持续更新,请访问我们的 GitHub 仓库:

声明

本模型提供的所有内容仅供研究和测试,模型开发者不对任何滥用行为负责。使用者需遵循相关法律法规,并承担因使用本模型产生的所有责任。

📂 GGUF File List

📁 Filename 📦 Size ⚡ Download
ggml-model-f16.gguf
Recommended LFS FP16
2.88 GB Download