|
|
--- |
|
|
license: apache-2.0 |
|
|
base_model: unsloth/DeepSeek-R1-Distill-Llama-8B |
|
|
tags: |
|
|
- text-generation |
|
|
- frontend |
|
|
- analysis |
|
|
- requirements |
|
|
- chinese |
|
|
- lora |
|
|
- peft |
|
|
- sft |
|
|
- trl |
|
|
- unsloth |
|
|
- conversational |
|
|
pipeline_tag: text-generation |
|
|
--- |
|
|
|
|
|
# analysis-llm-v2 |
|
|
|
|
|
这是一个基于 DeepSeek-R1-Distill-Llama-8B 微调的前端需求分析模型。 |
|
|
|
|
|
## 模型描述 |
|
|
|
|
|
该模型专门用于生成前端技术分析文档,能够: |
|
|
- 分析前端项目需求 |
|
|
- 生成详细的技术方案 |
|
|
- 提供页面路径规划 |
|
|
- 输出标准的前端项目结构 |
|
|
|
|
|
## 使用方法 |
|
|
|
|
|
### 使用HuggingFace格式 |
|
|
|
|
|
```python |
|
|
from transformers import AutoTokenizer, AutoModelForCausalLM |
|
|
import torch |
|
|
|
|
|
# 加载模型 |
|
|
model_name = "MANSTAGE/analysis-llm-v2" |
|
|
tokenizer = AutoTokenizer.from_pretrained(model_name) |
|
|
model = AutoModelForCausalLM.from_pretrained( |
|
|
model_name, |
|
|
torch_dtype=torch.float16, |
|
|
device_map="auto" |
|
|
) |
|
|
|
|
|
# 推理 |
|
|
question = "请帮我生成一个企业管理系统" |
|
|
inputs = tokenizer(question, return_tensors="pt").to(model.device) |
|
|
outputs = model.generate( |
|
|
**inputs, |
|
|
max_new_tokens=1000, |
|
|
temperature=0.7, |
|
|
do_sample=True |
|
|
) |
|
|
|
|
|
response = tokenizer.decode(outputs[0], skip_special_tokens=True) |
|
|
print(response) |
|
|
``` |
|
|
|
|
|
### 使用GGUF格式 |
|
|
|
|
|
本仓库包含多种GGUF量化格式: |
|
|
|
|
|
- `model_q4_0/` - 4位量化(最小文件大小) |
|
|
- `model_q4_k_m/` - 4位量化(平衡版本) |
|
|
- `model_q8_0/` - 8位量化(高质量) |
|
|
- `model_f16/` - 16位浮点(最高质量) |
|
|
|
|
|
使用llama.cpp加载GGUF文件: |
|
|
|
|
|
```bash |
|
|
# 下载GGUF文件 |
|
|
wget https://huggingface.co/MANSTAGE/analysis-llm-v2/resolve/main/model_q4_0/unsloth.Q4_0.gguf |
|
|
|
|
|
# 使用llama.cpp运行 |
|
|
./main -m unsloth.Q4_0.gguf -p "请帮我生成一个企业管理系统" |
|
|
``` |
|
|
|
|
|
## 训练详情 |
|
|
|
|
|
- **基础模型**: unsloth/DeepSeek-R1-Distill-Llama-8B |
|
|
- **训练数据**: 219条前端需求分析数据 |
|
|
- **训练步数**: 100步 |
|
|
- **学习率**: 2e-4 |
|
|
- **LoRA配置**: r=16, alpha=16, dropout=0.1 |
|
|
- **量化**: 4-bit量化训练 |
|
|
|
|
|
## 文件说明 |
|
|
|
|
|
- `final_model/` - HuggingFace格式的完整模型 |
|
|
- `model_q4_0/` - 4位量化GGUF文件 |
|
|
- `model_q4_k_m/` - 4位量化GGUF文件(平衡版) |
|
|
- `model_q8_0/` - 8位量化GGUF文件 |
|
|
- `model_f16/` - 16位浮点GGUF文件 |
|
|
|
|
|
## 许可证 |
|
|
|
|
|
Apache 2.0 |
|
|
|