[Fix]HTTP Stream raise exception (#11904)
This commit is contained in:
@@ -996,7 +996,11 @@ class TokenizerManager(TokenizerCommunicatorMixin):
|
||||
finish_reason.get("type") == "abort"
|
||||
and finish_reason.get("status_code") == HTTPStatus.BAD_REQUEST
|
||||
):
|
||||
raise ValueError(finish_reason["message"])
|
||||
if not obj.stream:
|
||||
raise ValueError(finish_reason["message"])
|
||||
else:
|
||||
yield out
|
||||
break
|
||||
|
||||
if finish_reason.get("type") == "abort" and finish_reason.get(
|
||||
"status_code"
|
||||
@@ -1013,11 +1017,14 @@ class TokenizerManager(TokenizerCommunicatorMixin):
|
||||
# Mark ongoing LoRA request as finished.
|
||||
if self.server_args.enable_lora and state.obj.lora_path:
|
||||
await self.lora_registry.release(state.obj.lora_id)
|
||||
|
||||
raise fastapi.HTTPException(
|
||||
status_code=finish_reason["status_code"],
|
||||
detail=finish_reason["message"],
|
||||
)
|
||||
if not obj.stream:
|
||||
raise fastapi.HTTPException(
|
||||
status_code=finish_reason["status_code"],
|
||||
detail=finish_reason["message"],
|
||||
)
|
||||
else:
|
||||
yield out
|
||||
break
|
||||
yield out
|
||||
break
|
||||
|
||||
|
||||
Reference in New Issue
Block a user