Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
robertgshaw2-redhat committed Jan 5, 2025
1 parent eba1717 commit d9547da
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 21 deletions.
14 changes: 7 additions & 7 deletions vllm/entrypoints/openai/serving_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ async def create_chat_completion(
truncate_prompt_tokens=request.truncate_prompt_tokens,
add_special_tokens=request.add_special_tokens,
)
except ValueError as e:
except Exception as e:
logger.exception("Error in preprocessing prompt inputs")
return self.create_error_response(str(e))

Expand Down Expand Up @@ -228,7 +228,7 @@ async def create_chat_completion(
)

generators.append(generator)
except ValueError as e:
except Exception as e:
# TODO: Use a vllm-specific Validation Error
return self.create_error_response(str(e))

Expand All @@ -245,7 +245,7 @@ async def create_chat_completion(
return await self.chat_completion_full_generator(
request, result_generator, request_id, model_name,
conversation, tokenizer, request_metadata)
except ValueError as e:
except Exception as e:
# TODO: Use a vllm-specific Validation Error
return self.create_error_response(str(e))

Expand Down Expand Up @@ -301,7 +301,7 @@ async def chat_completion_stream_generator(
] * num_choices
else:
tool_parsers = [None] * num_choices
except RuntimeError as e:
except Exception as e:
logger.exception("Error in tool parser creation.")
data = self.create_streaming_error_response(str(e))
yield f"data: {data}\n\n"
Expand Down Expand Up @@ -591,7 +591,7 @@ async def chat_completion_stream_generator(
completion_tokens=num_completion_tokens,
total_tokens=num_prompt_tokens + num_completion_tokens)

except ValueError as e:
except Exception as e:
# TODO: Use a vllm-specific Validation Error
logger.exception("Error in chat completion stream generator.")
data = self.create_streaming_error_response(str(e))
Expand All @@ -618,7 +618,7 @@ async def chat_completion_full_generator(
final_res = res
except asyncio.CancelledError:
return self.create_error_response("Client disconnected")
except ValueError as e:
except Exception as e:
# TODO: Use a vllm-specific Validation Error
return self.create_error_response(str(e))

Expand Down Expand Up @@ -682,7 +682,7 @@ async def chat_completion_full_generator(

try:
tool_parser = self.tool_parser(tokenizer)
except RuntimeError as e:
except Exception as e:
logger.exception("Error in tool parser creation.")
return self.create_error_response(str(e))

Expand Down
8 changes: 4 additions & 4 deletions vllm/entrypoints/openai/serving_completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ async def create_completion(
truncate_prompt_tokens=request.truncate_prompt_tokens,
add_special_tokens=request.add_special_tokens,
)
except ValueError as e:
except Exception as e:
logger.exception("Error in preprocessing prompt inputs")
return self.create_error_response(str(e))

Expand Down Expand Up @@ -158,7 +158,7 @@ async def create_completion(
)

generators.append(generator)
except ValueError as e:
except Exception as e:
# TODO: Use a vllm-specific Validation Error
return self.create_error_response(str(e))

Expand Down Expand Up @@ -215,7 +215,7 @@ async def create_completion(
)
except asyncio.CancelledError:
return self.create_error_response("Client disconnected")
except ValueError as e:
except Exception as e:
# TODO: Use a vllm-specific Validation Error
return self.create_error_response(str(e))

Expand Down Expand Up @@ -371,7 +371,7 @@ async def completion_stream_generator(
# report to FastAPI middleware aggregate usage across all choices
request_metadata.final_usage_info = final_usage_info

except ValueError as e:
except Exception as e:
# TODO: Use a vllm-specific Validation Error
data = self.create_streaming_error_response(str(e))
yield f"data: {data}\n\n"
Expand Down
6 changes: 3 additions & 3 deletions vllm/entrypoints/openai/serving_embedding.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ async def create_embedding(
truncate_prompt_tokens=truncate_prompt_tokens,
add_special_tokens=request.add_special_tokens,
)
except ValueError as e:
except Exception as e:
logger.exception("Error in preprocessing prompt inputs")
return self.create_error_response(str(e))

Expand Down Expand Up @@ -167,7 +167,7 @@ async def create_embedding(
)

generators.append(generator)
except ValueError as e:
except Exception as e:
# TODO: Use a vllm-specific Validation Error
return self.create_error_response(str(e))

Expand Down Expand Up @@ -196,7 +196,7 @@ async def create_embedding(
)
except asyncio.CancelledError:
return self.create_error_response("Client disconnected")
except ValueError as e:
except Exception as e:
# TODO: Use a vllm-specific Validation Error
return self.create_error_response(str(e))

Expand Down
6 changes: 3 additions & 3 deletions vllm/entrypoints/openai/serving_pooling.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ async def create_pooling(
truncate_prompt_tokens=truncate_prompt_tokens,
add_special_tokens=request.add_special_tokens,
)
except ValueError as e:
except Exception as e:
logger.exception("Error in preprocessing prompt inputs")
return self.create_error_response(str(e))

Expand Down Expand Up @@ -163,7 +163,7 @@ async def create_pooling(
)

generators.append(generator)
except ValueError as e:
except Exception as e:
# TODO: Use a vllm-specific Validation Error
return self.create_error_response(str(e))

Expand Down Expand Up @@ -192,7 +192,7 @@ async def create_pooling(
)
except asyncio.CancelledError:
return self.create_error_response("Client disconnected")
except ValueError as e:
except Exception as e:
# TODO: Use a vllm-specific Validation Error
return self.create_error_response(str(e))

Expand Down
6 changes: 3 additions & 3 deletions vllm/entrypoints/openai/serving_score.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ async def create_score(
if not self.model_config.is_cross_encoder:
raise ValueError("Model is not cross encoder.")

except ValueError as e:
except Exception as e:
logger.exception("Error in preprocessing prompt inputs")
return self.create_error_response(str(e))

Expand Down Expand Up @@ -155,7 +155,7 @@ async def create_score(
)

generators.append(generator)
except ValueError as e:
except Exception as e:
# TODO: Use a vllm-specific Validation Error
return self.create_error_response(str(e))

Expand Down Expand Up @@ -184,7 +184,7 @@ async def create_score(
)
except asyncio.CancelledError:
return self.create_error_response("Client disconnected")
except ValueError as e:
except Exception as e:
# TODO: Use a vllm-specific Validation Error
return self.create_error_response(str(e))

Expand Down
2 changes: 1 addition & 1 deletion vllm/entrypoints/openai/serving_tokenization.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ async def create_tokenize(
request.prompt,
add_special_tokens=request.add_special_tokens,
)
except ValueError as e:
except Exception as e:
logger.exception("Error in preprocessing prompt inputs")
return self.create_error_response(str(e))

Expand Down

0 comments on commit d9547da

Please sign in to comment.