🚀 数据科学编码模型
数据科学编码模型是一组经过微调的模型,旨在为数据科学应用的编码工作提供帮助。它有两种变体:1.3b 和 6.7b。这些模型是基于 DeepSeek Coder 的指令版本进行微调的。微调使用的数据集是 ed001/ds-coder-instruct-v1,该数据集是通过筛选 HuggingFace 上公开可用的数据集构建而成。
🚀 快速开始
🔧 安装库
确保已安装 transformers
库,可使用以下命令进行安装:
pip install transformers
🔍 使用示例
以下是使用该模型进行文本生成的示例代码:
from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline
def build_instruction_prompt(instruction):
return '''
You are the Data Science Coder, a helpful AI assistant created by a man named Ed.
You help people with data science coding and you answer questions about data science in a helpful manner.
### Instruction:
{}
### Response:
'''.format(instruction.strip()).lstrip()
tokenizer = AutoTokenizer.from_pretrained("ed001/datascience-coder-6.7b", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("ed001/datascience-coder-6.7b", trust_remote_code=True).cuda()
pipe = pipeline(task="text-generation", model=model, tokenizer=tokenizer, max_length=1024, top_p=0.95)
result = pipe(build_instruction_prompt("Perform EDA on the Iris dataset"))
print(result[0]['generated_text'])
✨ 主要特性
- 针对性微调:基于数据科学应用场景进行微调,能更好地处理数据科学相关的编码任务。
- 多变体选择:提供 1.3b 和 6.7b 两种变体,可根据不同需求选择合适的模型。
🔧 技术细节
训练参数
参数 |
值 |
lora_r |
16 |
lora_alpha |
8 |
lora_dropout |
0.05 |
target_modules |
q, k, v, o, gate_proj, down_proj, up_proj, lm_head |
weight_decay |
0 |
optmizer |
paged_adamw_32bit |
lr |
1e - 4 |
lr_scheduler |
cosine |
max_seq_len |
4096 |
batch_size |
4 |
max_grad_norm |
0.5 |
warmup_ratio |
0.05 |
num_epochs |
1 |
训练数据
模型在 ds - coder - instruct 数据集的 Python 子集上进行训练。
📊 评估结果
详细的评估结果可查看 此处。
指标 |
值 |
平均值 |
41.99 |
AI2 推理挑战 (25 - 样本) |
34.64 |
HellaSwag (10 - 样本) |
53.83 |
MMLU (5 - 样本) |
37.96 |
TruthfulQA (0 - 样本) |
44.82 |
Winogrande (5 - 样本) |
55.72 |
GSM8k (5 - 样本) |
24.94 |
📷 示例展示

📞 联系信息
GitHub: Ea0011
📄 许可证
本项目采用 CC - BY - NC - SA 4.0 许可证。