Unverified Commit d87f39e9 authored by DefTruth's avatar DefTruth Committed by GitHub
Browse files

[Bugfix] Add init_cached_hf_modules to RayWorkerWrapper (#4286)

parent d3c8180a
......@@ -100,6 +100,7 @@ class RayGPUExecutor(ExecutorBase):
)(RayWorkerWrapper).remote(
worker_module_name="vllm.worker.worker",
worker_class_name="Worker",
trust_remote_code=self.model_config.trust_remote_code,
)
worker_ip = ray.get(worker.get_node_ip.remote())
......@@ -110,6 +111,7 @@ class RayGPUExecutor(ExecutorBase):
self.driver_worker = RayWorkerWrapper(
worker_module_name="vllm.worker.worker",
worker_class_name="Worker",
trust_remote_code=self.model_config.trust_remote_code,
)
else:
# Else, added to the list of workers.
......
......@@ -103,10 +103,15 @@ class WorkerWrapperBase:
def __init__(self,
worker_module_name=None,
worker_class_name=None) -> None:
worker_class_name=None,
trust_remote_code: bool = False) -> None:
self.worker_module_name = worker_module_name
self.worker_class_name = worker_class_name
self.worker = None
if trust_remote_code:
# note: lazy import to avoid importing torch before initializing
from vllm.utils import init_cached_hf_modules
init_cached_hf_modules()
@staticmethod
def update_environment_variables(envs: Dict[str, str]) -> None:
......
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