File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
lazyllm/components/deploy Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,17 @@ def impl():
60
60
if self .random_port :
61
61
self .kw ['port' ] = random .randint (30000 , 40000 )
62
62
cmd = f'infinity_emb v2 --model-id { finetuned_model } '
63
+ if isinstance (self .launcher , launchers .EmptyLauncher ) and self .launcher .ngpus :
64
+ available_gpus = self .launcher ._get_idle_gpus ()
65
+ required_count = self .launcher .ngpus
66
+ if required_count <= len (available_gpus ):
67
+ gpu_ids = ',' .join (map (str , available_gpus [:required_count ]))
68
+ cmd += f'--device-id={ gpu_ids } '
69
+ else :
70
+ raise RuntimeError (
71
+ f"Insufficient GPUs available (required: { required_count } , "
72
+ f"available: { len (available_gpus )} )"
73
+ )
63
74
cmd += self .kw .parse_kwargs ()
64
75
if self .temp_folder : cmd += f' 2>&1 | tee { get_log_path (self .temp_folder )} '
65
76
return cmd
You can’t perform that action at this time.
0 commit comments