classification.ipynb

我要开发同款
匿名用户2024年07月31日
55阅读

技术信息

开源地址
https://modelscope.cn/models/wp3122101216/classification.ipynb

作品详情

Traiig procedure

Framework versios

  • SWIFT 1.5.1

Base model iformatio

队名:西安交通大学-心在飞翔队 使用模型:qwe-1.8b 数据库:京东情感分类数据库 实验环境:otebook 模型效果: 对情感进行简单的二分类,分为积极和消极两种情绪,根据用户输入的语句判断其内含的情感 示例代码:

使用swift框架

import os os.eviro['CUDAVISIBLEDEVICES'] = '0' import torch from swift.llm import ( DatasetName, IferArgumets, ModelType, SftArgumets, ifermai, sftmai, appuimai, mergeloramai )

选择1.8B模型

modeltype = ModelType.qwe18b sftargs = SftArgumets( modeltype=modeltype,

使用lora方法

sfttype='lora', traidataset_sample=2000,

调用京东的评论数据集

dataset=[DatasetName.jdsetimetzh], outputdir='output') result = sftmai(sft_args)

adapter的⼤⼩: 6.1MiB

bestmodelcheckpoit = result['bestmodelcheckpoit'] prit(f'bestmodelcheckpoit: {bestmodelcheckpoit}') torch.cuda.emptycache() iferargs = IferArgumets( ckptdir=bestmodelcheckpoit, loaddatasetcofig=True, dosample=False) result = ifermai(iferargs)

  • BaseModel Class QWeLMHeadModel

功能介绍

Training procedure Framework versions SWIFT 1.5.1 Base model information 队名:西安交通大学-心在飞翔队 使用模型:qwen

声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论