Jelajahi Sumber

Revert "fix triton token2wav model cache thread unsafety"

This reverts commit cd26dd19329a2e3f56ce530d4a062a438c20ea06.
김의진 3 bulan lalu
induk
melakukan
fa2781405f
1 mengubah file dengan 3 tambahan dan 4 penghapusan
  1. 3 4
      runtime/triton_trtllm/model_repo/token2wav/1/model.py

+ 3 - 4
runtime/triton_trtllm/model_repo/token2wav/1/model.py

@@ -28,7 +28,6 @@ import json
 import os
 
 import logging
-from uuid import uuid4
 
 import torch
 from torch.utils.dlpack import to_dlpack
@@ -236,17 +235,17 @@ class TritonPythonModel:
                     stream = True
                 else:
                     stream = False
-                uuid = uuid4().hex
+                request_id = request.request_id()
                 audio_hat = self.token2wav_model.model.token2wav(token=target_speech_tokens,
                                                                  prompt_token=prompt_speech_tokens,
                                                                  prompt_feat=prompt_speech_feat,
                                                                  embedding=prompt_spk_embedding,
                                                                  token_offset=token_offset,
-                                                                 uuid=uuid,
+                                                                 uuid=request_id,
                                                                  stream=stream,
                                                                  finalize=finalize)
                 if finalize:
-                    self.token2wav_model.model.hift_cache_dict.pop(uuid)
+                    self.token2wav_model.model.hift_cache_dict.pop(request_id)
 
             else:
                 tts_mel, _ = self.token2wav_model.model.flow.inference(