From d1ba5616fe2121f44617e4d7993905e2e0b38d8a Mon Sep 17 00:00:00 2001 From: Fanyi Pu Date: Thu, 18 Apr 2024 03:49:25 +0800 Subject: [PATCH] Fix condition for checking accelerator.num_processes in Llava class --- lmms_eval/models/llava.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lmms_eval/models/llava.py b/lmms_eval/models/llava.py index 531b85eab..0671dd15d 100644 --- a/lmms_eval/models/llava.py +++ b/lmms_eval/models/llava.py @@ -88,7 +88,7 @@ def __init__( self.use_cache = use_cache self.truncate_context = truncate_context # assert self.batch_size_per_gpu == 1, "Llava currently does not support batched generation. See https://github.com/haotian-liu/LLaVA/issues/754. HF Llava also has this issue." - if accelerator.num_processes > 1 and device_map == "": + if accelerator.num_processes > 1 and device_map == "auto": assert accelerator.distributed_type in [DistributedType.FSDP, DistributedType.MULTI_GPU, DistributedType.DEEPSPEED], "Unsupported distributed type provided. Only DDP and FSDP are supported." # If you want to use DistributedType.DEEPSPEED, you have to run accelerate config before using the model # Also, you have to select zero stage 0 (equivalent to DDP) in order to make the prepare model works