Unverified Commit aa4eb0db authored by Kunshang Ji's avatar Kunshang Ji Committed by GitHub
Browse files

[CI]revert initialize_model context manager (#38426)


Signed-off-by: default avatarKunshang Ji <jikunshang95@gmail.com>
Co-authored-by: default avatarwang.yuqi <yuqi.wang@daocloud.io>
parent af89140e
...@@ -50,10 +50,14 @@ class BaseModelLoader(ABC): ...@@ -50,10 +50,14 @@ class BaseModelLoader(ABC):
device_config.device if load_config.device is None else load_config.device device_config.device if load_config.device is None else load_config.device
) )
target_device = torch.device(load_device) target_device = torch.device(load_device)
with set_default_torch_dtype(model_config.dtype), target_device: with set_default_torch_dtype(model_config.dtype):
with target_device:
model = initialize_model( model = initialize_model(
vllm_config=vllm_config, model_config=model_config, prefix=prefix vllm_config=vllm_config,
model_config=model_config,
prefix=prefix,
) )
log_model_inspection(model) log_model_inspection(model)
logger.debug("Loading weights on %s ...", load_device) logger.debug("Loading weights on %s ...", load_device)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment