---
title: qwen2-7b-classical-zh-instruct
canonical_url: "https://www.modelscope.cn/models/swift/qwen2-7b-classical-zh-instruct"
md_url: "https://www.modelscope.cn/models/swift/qwen2-7b-classical-zh-instruct.md"
repository: swift/qwen2-7b-classical-zh-instruct
chinese_name: "Qwen2古文翻译腔7B"
last_updated: 2024-07-01
license: "Apache License 2.0"
pipeline_tag: text-generation
tasks:
  - text-generation
model_type:
  - qwen2
architectures:
  - Qwen2ForCausalLM
parameters: 7.6B
tensor_type:
  - BF16
library_name:
  - safetensors
  - pytorch
frameworks:
  - Pytorch
inference_backends:
  - "deploy_task text/emb"
  - "lmdeploy 0.9.1"
  - "lmdeploy_turbomind 0.9.1"
  - "sglang 0.5.2"
  - "vllm 0.9.2"
downloads: 208
stars: 6
---

# qwen2-7b-classical-zh-instruct

> qwen2-7b-classical-zh-instruct - swift 在 ModelScope 开源的模型。如果您是本模型的贡献者，我们邀请您根据 模型贡献文档 ，及时完善模型卡片内容。

swift/qwen2-7b-classical-zh-instruct 是 ModelScope 魔搭社区上的 7.6B 参数text-generation模型，采用 Apache License 2.0 许可，可用 deploy_task text/emb、lmdeploy 0.9.1、lmdeploy_turbomind 0.9.1 部署。

- **Repository**: swift/qwen2-7b-classical-zh-instruct
- **License**: Apache License 2.0
- **Tasks**: text-generation
- **Parameters**: 7.6B
- **Inference backends**: deploy_task text/emb, lmdeploy 0.9.1, lmdeploy_turbomind 0.9.1, sglang 0.5.2, vllm 0.9.2
- **Downloads**: 208
- **Stars**: 6
- **Last updated**: 2024-07-01

Source: https://www.modelscope.cn/models/swift/qwen2-7b-classical-zh-instruct

---

模型由SWIFT框架训练，命令：
```shell
CUDA_VISIBLE_DEVICES=0 \
swift sft \
    --model_type qwen2-7b-instruct \
    --sft_type lora \
    --output_dir output \
    --dataset classical-chinese-translate \
    --num_train_epochs 1 \
    --max_length 1024 \
    --check_dataset_strategy warning \
    --lora_rank 8 \
    --lora_alpha 32 \
    --lora_dropout_p 0.05 \
    --lora_target_modules ALL \
    --gradient_checkpointing true \
    --batch_size 1 \
    --weight_decay 0.1 \
    --learning_rate 5e-5 \
    --gradient_accumulation_steps 16 \
    --max_grad_norm 1.0 \
    --warmup_ratio 0.03 \
    --eval_steps 100 \
    --save_steps 100 \
    --save_total_limit 2 \
    --logging_steps 10
```

数据集使用的是[古文翻译腔数据集](https://www.modelscope.cn/datasets/swift/classical_chinese_translate)

用来生成古文翻译调调的回复：

```text
Q: 树上有十只鸟，用枪打死一只，还剩多少只？
A: 我听说在大自然中，鸟儿们总是成群结队地飞翔，枪声一响，它们便会四散而逃。如今打死一只，其余的鸟儿岂能不惊慌失措？恐怕连一只也剩不下啊！世间万物，岂能不互相影响？这难道不是显而易见的道理吗？
```

<p style="color: lightgrey;">如果您是本模型的贡献者，我们邀请您根据<a href="https://modelscope.cn/docs/ModelScope%E6%A8%A1%E5%9E%8B%E6%8E%A5%E5%85%A5%E6%B5%81%E7%A8%8B%E6%A6%82%E8%A7%88" style="color: lightgrey; text-decoration: underline;">模型贡献文档</a>，及时完善模型卡片内容。</p>
