Skip to content

Commit 359104f

Browse files
author
Your Name
committed
error response
1 parent 1965737 commit 359104f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

vllm/beam/filtering.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,15 @@ async def get_n_valid_beams(self, create_completion: Callable,
6767

6868
def validate(self, responses: list[AsyncGenerator],
6969
debug_infos_G: list[BeamDebugInfo] = None):
70+
error_responses = [r for r in responses if isinstance(r, ErrorResponse)]
71+
if len(error_responses) > 0:
72+
combined_message = "; ".join(er.message for er in error_responses)
73+
return ErrorResponse(
74+
message=combined_message,
75+
type=error_responses[0].type,
76+
code=error_responses[0].code
77+
)
78+
7079
# TODO(@tanuj) - share this with the beam scorer
7180
heads = [response.choices[0].additional_heads[0] for response in responses]
7281
heads_tensor = torch.tensor(heads, dtype=torch.float)

0 commit comments

Comments
 (0)