队名:西安交通大学-心在飞翔队
使用模型:qwe-1.8b
数据库:京东情感分类数据库
实验环境:otebook
模型效果:
对情感进行简单的二分类,分为积极和消极两种情绪,根据用户输入的语句判断其内含的情感
示例代码: import os
os.eviro['CUDAVISIBLEDEVICES'] = '0'
import torch
from swift.llm import (
DatasetName, IferArgumets, ModelType, SftArgumets,
ifermai, sftmai, appuimai, mergeloramai
) modeltype = ModelType.qwe18b
sftargs = SftArgumets(
modeltype=modeltype, sfttype='lora',
traidataset_sample=2000, dataset=[DatasetName.jdsetimetzh],
outputdir='output')
result = sftmai(sft_args) bestmodelcheckpoit = result['bestmodelcheckpoit']
prit(f'bestmodelcheckpoit: {bestmodelcheckpoit}')
torch.cuda.emptycache()
iferargs = IferArgumets(
ckptdir=bestmodelcheckpoit,
loaddatasetcofig=True,
dosample=False)
result = ifermai(iferargs)Traiig procedure
Framework versios
Base model iformatio
使用swift框架
选择1.8B模型
使用lora方法
调用京东的评论数据集
adapter的⼤⼩: 6.1MiB
点击空白处退出提示
评论