qwen-7b-finetune-code

我要开发同款
匿名用户2024年07月31日
28阅读
所属分类aipytorch
开源地址https://modelscope.cn/models/huhu246/qwen-7b-finetune-code

作品详情

Training procedure

Framework versions

  • SWIFT 1.6.0.dev0
git clone https://github.com/modelscope/swift.git
cd swift
pip install -e .[llm] 

model finetune config

  • finetune config
sft_args = SftArguments(
    model_type=ModelType.qwen_7b_chat,
    model_cache_dir='/mnt/nvme1/yongyang/llm_weights/qwen/Qwen-7B-Chat',
    dataset=[DatasetName.leetcode_python_en],
    train_dataset_sample=2000,
    eval_steps=20,
    logging_steps=5,
    output_dir='output',
    lora_target_modules='ALL',
    self_cognition_sample=500,
    model_name=['呼呼', 'huhu'],
    model_author=['AI大模型实践小组', 'AI group'])

model inference

import os
os.environ['CUDA_VISIBLE_DEVICES'] = '0'

from swift.llm import ModelType, InferArguments, merge_lora_main, infer_main
best_model_checkpoint = 'path to model checkpoint'
infer_args = InferArguments(
    model_type=ModelType.qwen_7b_chat, 
    model_cache_dir='/mnt/nvme1/yongyang/llm_weights/qwen/Qwen-7B-Chat',
    ckpt_dir=best_model_checkpoint,
    eval_human=True)
result = infer_main(infer_args)
声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论