|
30 | 30 | import os |
31 | 31 | import queue |
32 | 32 | import threading |
| 33 | +import traceback |
33 | 34 | from typing import Dict, List |
34 | 35 |
|
35 | 36 | import numpy as np |
@@ -244,7 +245,9 @@ def _init_engine(self): |
244 | 245 | # failed to start, so the exception is passed back via the engine variable. |
245 | 246 | if isinstance(self._llm_engine, Exception): |
246 | 247 | e = self._llm_engine |
247 | | - self.logger.log_error(f"[vllm] Failed to start engine: {e}") |
| 248 | + self.logger.log_error( |
| 249 | + f"[vllm] Failed to start engine: {traceback.format_exc()}" |
| 250 | + ) |
248 | 251 | if self._event_thread is not None: |
249 | 252 | self._event_thread.join() |
250 | 253 | self._event_thread = None |
@@ -398,7 +401,7 @@ def _response_loop(self): |
398 | 401 | response_state["is_cancelled"] = response_sender.is_cancelled() |
399 | 402 | except Exception as e: |
400 | 403 | self.logger.log_error( |
401 | | - f"An error occurred while sending a response: {e}" |
| 404 | + f"An error occurred while sending a response: {traceback.format_exc()}" |
402 | 405 | ) |
403 | 406 | finally: |
404 | 407 | if response_flag == pb_utils.TRITONSERVER_RESPONSE_COMPLETE_FINAL: |
@@ -533,7 +536,9 @@ async def _infer(self, request): |
533 | 536 | ) |
534 | 537 |
|
535 | 538 | except Exception as e: |
536 | | - self.logger.log_error(f"[vllm] Error generating stream: {e}") |
| 539 | + self.logger.log_error( |
| 540 | + f"[vllm] Error generating stream: {traceback.format_exc()}" |
| 541 | + ) |
537 | 542 | error = pb_utils.TritonError(f"Error generating stream: {e}") |
538 | 543 | text_output_tensor = pb_utils.Tensor( |
539 | 544 | "text_output", np.asarray(["N/A"], dtype=self.output_dtype) |
@@ -591,7 +596,7 @@ def _check_health(self, requests): |
591 | 596 | future.result() |
592 | 597 | except Exception as e: |
593 | 598 | self.logger.log_error( |
594 | | - f"[vllm] Engine is not healthy and model will be unloaded: {e}" |
| 599 | + f"[vllm] Engine is not healthy and model will be unloaded: {traceback.format_exc()}" |
595 | 600 | ) |
596 | 601 | pb_utils.unload_model(self.model_config["name"]) # non-blocking |
597 | 602 | self._is_healthy = False |
|
0 commit comments