Traiig procedure
Framework versios
git cloe https://github.com/modelscope/swift.git
cd swift
pip istall -e .[llm]
model fietue cofig
sft_args = SftArgumets(
model_type=ModelType.qwe_7b_chat,
model_cache_dir='/mt/vme1/yogyag/llm_weights/qwe/Qwe-7B-Chat',
dataset=[DatasetName.leetcode_pytho_e],
trai_dataset_sample=2000,
eval_steps=20,
loggig_steps=5,
output_dir='output',
lora_target_modules='ALL',
self_cogitio_sample=500,
model_ame=['呼呼', 'huhu'],
model_author=['AI大模型实践小组', 'AI group'])
model iferece
import os
os.eviro['CUDA_VISIBLE_DEVICES'] = '0'
from swift.llm import ModelType, IferArgumets, merge_lora_mai, ifer_mai
best_model_checkpoit = 'path to model checkpoit'
ifer_args = IferArgumets(
model_type=ModelType.qwe_7b_chat,
model_cache_dir='/mt/vme1/yogyag/llm_weights/qwe/Qwe-7B-Chat',
ckpt_dir=best_model_checkpoit,
eval_huma=True)
result = ifer_mai(ifer_args)
点击空白处退出提示
评论