Upgrade tensorrt_llm to v0.18.2

Signed-off-by: makaveli10 <vineet.suryan@collabora.com>
This commit is contained in:
makaveli10
2025-04-22 12:33:03 +00:00
parent d9cb4ffdd0
commit 47ee035f65
8 changed files with 134 additions and 57 deletions
+11 -7
View File
@@ -153,7 +153,7 @@ class TranscriptionServer:
def initialize_client(
self, websocket, options, faster_whisper_custom_model_path,
whisper_tensorrt_path, trt_multilingual
whisper_tensorrt_path, trt_multilingual, trt_py_session=False,
):
client: Optional[ServeClientBase] = None
@@ -168,6 +168,7 @@ class TranscriptionServer:
client_uid=options["uid"],
model=whisper_tensorrt_path,
single_model=self.single_model,
use_py_session=trt_py_session,
)
logging.info("Running TensorRT backend.")
except Exception as e:
@@ -248,7 +249,7 @@ class TranscriptionServer:
return np.frombuffer(frame_data, dtype=np.float32)
def handle_new_connection(self, websocket, faster_whisper_custom_model_path,
whisper_tensorrt_path, trt_multilingual):
whisper_tensorrt_path, trt_multilingual, trt_py_session=False):
try:
logging.info("New client connected")
options = websocket.recv()
@@ -267,7 +268,7 @@ class TranscriptionServer:
if self.backend.is_tensorrt():
self.vad_detector = VoiceActivityDetector(frame_rate=self.RATE)
self.initialize_client(websocket, options, faster_whisper_custom_model_path,
whisper_tensorrt_path, trt_multilingual)
whisper_tensorrt_path, trt_multilingual, trt_py_session=trt_py_session)
return True
except json.JSONDecodeError:
logging.error("Failed to decode JSON from client")
@@ -299,11 +300,12 @@ class TranscriptionServer:
return True
def recv_audio(self,
websocket,
websocket,
backend: BackendType = BackendType.FASTER_WHISPER,
faster_whisper_custom_model_path=None,
whisper_tensorrt_path=None,
trt_multilingual=False):
trt_multilingual=False,
trt_py_session=False):
"""
Receive audio chunks from a client in an infinite loop.
@@ -330,7 +332,7 @@ class TranscriptionServer:
"""
self.backend = backend
if not self.handle_new_connection(websocket, faster_whisper_custom_model_path,
whisper_tensorrt_path, trt_multilingual):
whisper_tensorrt_path, trt_multilingual, trt_py_session=trt_py_session):
return
try:
@@ -354,6 +356,7 @@ class TranscriptionServer:
faster_whisper_custom_model_path=None,
whisper_tensorrt_path=None,
trt_multilingual=False,
trt_py_session=False,
single_model=False):
"""
Run the transcription server.
@@ -381,7 +384,8 @@ class TranscriptionServer:
backend=BackendType(backend),
faster_whisper_custom_model_path=faster_whisper_custom_model_path,
whisper_tensorrt_path=whisper_tensorrt_path,
trt_multilingual=trt_multilingual
trt_multilingual=trt_multilingual,
trt_py_session=trt_py_session,
),
host,
port