From 515227966a66d4db215d910112e99bf14da4f2ad Mon Sep 17 00:00:00 2001 From: Antoni Baum Date: Mon, 1 Jul 2024 13:12:40 -0700 Subject: [PATCH] [Bugfix] Use RayActorError for older versions of Ray in RayTokenizerGroupPool (#6039) Signed-off-by: Alvant --- .../tokenizer_group/ray_tokenizer_group.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vllm/transformers_utils/tokenizer_group/ray_tokenizer_group.py b/vllm/transformers_utils/tokenizer_group/ray_tokenizer_group.py index 21ec2b52bc95e..799ca7d3f15c0 100644 --- a/vllm/transformers_utils/tokenizer_group/ray_tokenizer_group.py +++ b/vllm/transformers_utils/tokenizer_group/ray_tokenizer_group.py @@ -2,7 +2,11 @@ import os from typing import List, Optional -from ray.exceptions import ActorDiedError +try: + from ray.exceptions import ActorDiedError +except ImportError: + # For older versions of Ray + from ray.exceptions import RayActorError as ActorDiedError from ray.util.scheduling_strategies import NodeAffinitySchedulingStrategy from transformers import PreTrainedTokenizer