A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 15, 12:15 UTC
[BugFix] Fix authorization of openai_transcription_client.py (#17321)
Signed-off-by: zh Wang <rekind133@outlook.com>
zh Wang committed
May 1, 2025 at 00:51 UTC
d586ddc691eadb7f5d8eb390da8035e5cb6c30d9
1 file changed
+6
-2
examples/online_serving/openai_transcription_client.py
+6
-2
@@ -46,11 +46,15 @@ async def stream_openai_response():
46
"model": "openai/whisper-large-v3",
47
}
48
url = openai_api_base + "/audio/transcriptions"
49
+ headers = {"Authorization": f"Bearer {openai_api_key}"}
50
print("transcription result:", end=' ')
51
async with httpx.AsyncClient() as client:
52
with open(str(winning_call), "rb") as f:
52
- async with client.stream('POST', url, files={'file': f},
53
- data=data) as response:
53
+ async with client.stream('POST',
54
+ url,
55
+ files={'file': f},
56
+ data=data,
57
+ headers=headers) as response:
58
async for line in response.aiter_lines():
59
# Each line is a JSON object prefixed with 'data: '
60
if line: