启用安静模式(--quiet)
用户调用CLI接口时,如无需接收风险提示,可在命令首个参数中添加“--quiet”参数,以启用安静模式。开启该模式后,默认接受除“boot_file_path”外其他潜在的风险,即可跳过CLI的交互式提示。
命令示例
tk finetune --quiet --data_path /home/HwAiUser/datasets/ --output_path /home/HwAiUser/output/ -- pretrained_model_path /home/HwAiUser/pretrained_models/ --model_config_path /home/HwAiUser/config/model_config_finetune.yaml --boot_file_path /home/HwAiUser/finetune.py
“--quiet”参数必须放在首位。
启用安静模式之后,存在权限风险时,提示机制变为:
接口 |
参数项 |
风险操作 |
CLI |
CLI安静模式 |
Python接口 |
---|---|---|---|---|---|
finetune |
pretrained_model_path |
输入参数路径指向文件/文件夹访问权限设置过于宽松,有提权风险。 |
交互式风险提醒,由用户选择是否接受风险继续业务。 |
warning日志提醒。 |
warning日志提醒。 |
evaluate/infer |
ckpt_path |
||||
finetune/evaluate/infer |
data_path |
||||
output_path |
|||||
model_config_path |
|||||
boot_file_path |
返回报错。 |
返回报错。 |
父主题: 接口风险警示