Skip to content

Commit b133bd2

Browse files
authored
fix tp lmdeploy (#1654)
1 parent 601e055 commit b133bd2

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

swift/llm/utils/argument.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,8 +507,11 @@ def load_from_ckpt_dir(self, is_sft: bool = False) -> None:
507507
imported_keys = [
508508
'model_type', 'model_revision', 'template_type', 'dtype', 'quant_method', 'quantization_bit',
509509
'bnb_4bit_comp_dtype', 'bnb_4bit_quant_type', 'bnb_4bit_use_double_quant', 'model_id_or_path',
510-
'custom_register_path', 'custom_dataset_info', 'tp', 'pp'
510+
'custom_register_path', 'custom_dataset_info'
511511
]
512+
if (isinstance(self, SftArguments) and self.train_backend == 'megatron'
513+
or isinstance(self, ExportArguments) and self.to_hf is True):
514+
imported_keys += ['tp', 'pp']
512515
if not is_sft:
513516
imported_keys += ['sft_type', 'rope_scaling', 'system']
514517
if getattr(self, 'load_dataset_config', False) and from_sft_args:

swift/llm/utils/model.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4309,6 +4309,7 @@ def new_get_rank(group=None):
43094309
eos_token='<|im_end|>',
43104310
support_flash_attn=True,
43114311
support_lmdeploy=True,
4312+
requires=['decord'],
43124313
tags=['multi-modal', 'vision'],
43134314
function_kwargs={'version': 'v2.5'},
43144315
hf_model_id='internlm/internlm-xcomposer2d5-7b')

0 commit comments

Comments
 (0)