初始化项目,由ModelHub XC社区提供模型
Model: EugeneMeng/Short-Drama-Title-Generator-4B Source: Original Platform
This commit is contained in:
87
README.md
Normal file
87
README.md
Normal file
@@ -0,0 +1,87 @@
|
||||
---
|
||||
license: apache-2.0
|
||||
language:
|
||||
- zh
|
||||
tags:
|
||||
- qwen
|
||||
- text-generation
|
||||
- short-drama
|
||||
- lora
|
||||
- finetune
|
||||
pipeline_tag: text-generation
|
||||
base_model:
|
||||
- Qwen/Qwen3-4B-Instruct-2507
|
||||
datasets:
|
||||
- EugeneMeng/Hongguo-Short-Drama-Corpus-AI-Labeled
|
||||
---
|
||||
|
||||
# Short-Drama-Title-Generator-4B (微短剧爆款剧名生成大模型)
|
||||
|
||||
[中文介绍](#中文介绍) | [English Introduction](#english)
|
||||
|
||||
<a id="中文介绍"></a>
|
||||
## 🎬 模型介绍
|
||||
**Short-Drama-Title-Generator-4B** 是一款基于 Qwen3-4B-Instruct 深度微调的“微短剧爆款剧名生成器”。
|
||||
|
||||
本模型使用了高达 **20,205 条真实的爆款微短剧数据集**(涵盖女频、男频、战神、甜宠、穿书、系统、打脸虐渣等全品类)进行指令微调(SFT)。模型深谙下沉市场用户的心理与短剧“网感”,能够根据简单的剧情简介和标签,一键生成极具爽感、能引发病毒式传播的微短剧剧名。
|
||||
|
||||
**核心应用场景**:
|
||||
* 短剧编剧/导演快速起名
|
||||
* 网文小说作者灵感激发
|
||||
* 短视频信息流广告素材起标题
|
||||
|
||||
## 🚀 快速开始 (Quick Start)
|
||||
|
||||
### 1. 依赖安装
|
||||
```bash
|
||||
pip install transformers accelerate vllm
|
||||
```
|
||||
|
||||
### 2. Python 推理示例
|
||||
我们推荐使用 `transformers` 库进行快速调用。请确保你遵循了训练时的 Prompt 格式(即包含【标签】和【简介】)。
|
||||
|
||||
```python
|
||||
from transformers import AutoModelForCausalLM, AutoTokenizer
|
||||
|
||||
|
||||
model_name = "EugeneMeng/Short-Drama-Title-Generator-4B"
|
||||
|
||||
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
||||
model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto", torch_dtype="auto")
|
||||
|
||||
# 你的指令和输入
|
||||
instruction = "你是一名深谙下沉市场心理的顶级微短剧编剧。请根据以下剧情简介,为这部【女频】短剧起一个极具爽感、能引发病毒式传播的爆款剧名。"
|
||||
input_text = "【标签】[\"都市爱情\", \"追妻火葬场\", \"打脸虐渣\"]\n【简介】林湘看清自己不过是父亲用来挽救公司、被塞进豪门的“工具人”。三年协议婚姻,她忍下冷暴力与流言。幡然醒悟后,她踢走势利保姆,重返职场,活成了前夫高攀不起的模样。"
|
||||
|
||||
messages = [
|
||||
{"role": "system", "content": "You are a helpful assistant."},
|
||||
{"role": "user", "content": f"{instruction}\n{input_text}"}
|
||||
]
|
||||
|
||||
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
||||
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
|
||||
|
||||
# 生成剧名
|
||||
generated_ids = model.generate(**model_inputs, max_new_tokens=50, temperature=0.7)
|
||||
generated_ids = [
|
||||
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
|
||||
]
|
||||
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
||||
|
||||
print("生成的剧名:", response)
|
||||
```
|
||||
|
||||
### 3. Ollama 本地运行
|
||||
文件包含‘Modelfile`,如果你熟悉 Ollama 生态,可以直接将其转换为 GGUF 并进行极其方便的本地部署调用。
|
||||
|
||||
---
|
||||
|
||||
<a id="english"></a>
|
||||
## 🎬 Model Description (English)
|
||||
|
||||
**Short-Drama-Title-Generator-4B** is a specialized Large Language Model fine-tuned on the Qwen3-4B-Instruct architecture. It is designed to generate highly engaging, viral, and click-worthy titles for Chinese Short Dramas (微短剧).
|
||||
|
||||
The model was meticulously fine-tuned on a high-quality dataset containing **20,205 real-world popular short drama titles and plots**. It excels at extracting core elements from a brief plot summary and outputting titles that strongly appeal to target audiences in the short video ecosystem.
|
||||
|
||||
## ⚠️ 免责声明 (Disclaimer)
|
||||
本模型生成的剧名仅供参考,生成结果受输入文本和模型生成随机性影响。请用户在使用时遵守相关法律法规,不得用于生成、传播任何违法违规或侵犯他人权益的内容。
|
||||
Reference in New Issue
Block a user