daihui.zhang
commited on
Commit
·
783b899
1
Parent(s):
69bc449
add readme info
Browse files
transcribe/whisper_llm_serve.py
CHANGED
|
@@ -116,7 +116,7 @@ class PywhisperInference:
|
|
| 116 |
whisper_model = None
|
| 117 |
llm_model = None
|
| 118 |
vad_model = None
|
| 119 |
-
|
| 120 |
|
| 121 |
@classmethod
|
| 122 |
def initializer(cls, event:mp.Event, warmup=True):
|
|
@@ -134,7 +134,7 @@ class PywhisperInference:
|
|
| 134 |
# init llamacpp
|
| 135 |
cls.llm_model = QwenTranslator(config.LLM_MODEL_PATH, config.LLM_SYS_PROMPT)
|
| 136 |
cls.vad_model = VoiceActivityDetector()
|
| 137 |
-
|
| 138 |
event.set()
|
| 139 |
|
| 140 |
|
|
@@ -391,10 +391,6 @@ class PyWhiperCppServe(ServeClientBase):
|
|
| 391 |
)
|
| 392 |
|
| 393 |
def send_to_client(self, data:TransResult):
|
| 394 |
-
# content = {
|
| 395 |
-
# "uid": self.client_uid,
|
| 396 |
-
# **data_dict
|
| 397 |
-
# }
|
| 398 |
try:
|
| 399 |
self.websocket.send(
|
| 400 |
Message(result=data, request_id=self.client_uid).model_dump_json(by_alias=True)
|
|
|
|
| 116 |
whisper_model = None
|
| 117 |
llm_model = None
|
| 118 |
vad_model = None
|
| 119 |
+
|
| 120 |
|
| 121 |
@classmethod
|
| 122 |
def initializer(cls, event:mp.Event, warmup=True):
|
|
|
|
| 134 |
# init llamacpp
|
| 135 |
cls.llm_model = QwenTranslator(config.LLM_MODEL_PATH, config.LLM_SYS_PROMPT)
|
| 136 |
cls.vad_model = VoiceActivityDetector()
|
| 137 |
+
|
| 138 |
event.set()
|
| 139 |
|
| 140 |
|
|
|
|
| 391 |
)
|
| 392 |
|
| 393 |
def send_to_client(self, data:TransResult):
|
|
|
|
|
|
|
|
|
|
|
|
|
| 394 |
try:
|
| 395 |
self.websocket.send(
|
| 396 |
Message(result=data, request_id=self.client_uid).model_dump_json(by_alias=True)
|