开发者社区 > ModelScope模型即服务 > 正文

推理时候报错,说没有图中modelscope文件,怎么处理?

"推理时候报错,说没有图中modelscope文件,怎么处理? ca79affd70dee8d21cddac8345adfcb4.jpg

!/bin/bash

分布式,训练指定显卡

export CUDA_DEVICE_MAX_CONNECTIONS=1
DIR=pwd

export CUDA_VISIBLE_DEVICES=1,2,3

GPUS_PER_NODE=3
NNODES=1
NODE_RANK=0
MASTER_ADDR=localhost
MASTER_PORT=6001

MODEL=""Qwen/Qwen-VL-Chat-Int4"" # Qwen/Qwen-VL-Chat-Int4 Set the path if you do not want to load from huggingface directly

ATTENTION: specify the path to your training data, which should be a json file consisting of a list of conversations.

See the section for finetuning in README for more information.

DATA=""data/train_data.json""

DISTRIBUTED_ARGS=""
--nproc_per_node $GPUS_PER_NODE \
--nnodes $NNODES \
--node_rank $NODE_RANK \
--master_addr $MASTER_ADDR \
--master_port $MASTER_PORT
""

Remember to use --fp16 instead of --bf16 due to autogptq

torchrun $DISTRIBUTED_ARGS finetune.py \
--model_name_or_path $MODEL \
--data_path $DATA \
--fp16 True \
--fix_vit True \
--output_dir output_qlora_model \
--num_train_epochs 5 \
--per_device_train_batch_size 2 \
--per_device_eval_batch_size 1 \
--gradient_accumulation_steps 8 \
--evaluation_strategy ""no"" \
--save_strategy ""steps"" \
--save_steps 50 \
--save_total_limit 10 \
--learning_rate 1e-5 \
--weight_decay 0.1 \
--adam_beta2 0.95 \
--warmup_ratio 0.01 \
--lr_scheduler_type ""cosine"" \
--logging_steps 1 \
--report_to ""none"" \
--model_max_length 2048 \
--lazy_preprocess True \
--use_lora \
--q_lora \
--gradient_checkpointing \
--deepspeed finetune/ds_config_zero2.json"

展开
收起
小小爱吃香菜 2024-05-29 08:43:36 20 0
1 条回答
写回答
取消 提交回答

ModelScope旨在打造下一代开源的模型即服务共享平台,为泛AI开发者提供灵活、易用、低成本的一站式模型服务产品,让模型应用更简单!欢迎加入技术交流群:微信公众号:魔搭ModelScope社区,钉钉群号:44837352

相关电子书

更多
视觉AI能力的开放现状及ModelScope实战 立即下载
ModelScope助力语音AI模型创新与应用 立即下载
低代码开发师(初级)实战教程 立即下载