Skip to content

Commit bfbc3f5

Browse files
author
LittleMouse
committed
[fix] Fix language parameter passing
1 parent 3347707 commit bfbc3f5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

backend/asr_client_backend.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def __init__(self, model_config):
2323
port=self.config["port"]
2424
)
2525

26-
async def _get_client(self):
26+
async def _get_client(self, language: str):
2727
try:
2828
await asyncio.wait_for(self._pool_lock.acquire(), timeout=30.0)
2929

@@ -65,7 +65,7 @@ async def _get_client(self):
6565
"model": self.config["model_name"],
6666
"response_format": "asr.utf-8",
6767
"input": "whisper.wav.stream.base64",
68-
"language": "zh",
68+
"language": language,
6969
"enoutput": True
7070
}
7171
)
@@ -104,7 +104,7 @@ async def _inference(self, client, audio_b64: str):
104104
return full_result
105105

106106
async def create_transcription(self, audio_data: bytes, language: str = "zh", prompt: str = "") -> str:
107-
client = await self._get_client()
107+
client = await self._get_client(language)
108108
task = asyncio.current_task()
109109
self._active_tasks.add(task)
110110
try:

0 commit comments

Comments
 (0)