mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-09 23:15:31 +08:00
[BugFix] Fix authorization of openai_transcription_client.py (#17321)
Signed-off-by: zh Wang <rekind133@outlook.com>
This commit is contained in:
parent
0b7e701dd4
commit
d586ddc691
@ -46,11 +46,15 @@ async def stream_openai_response():
|
||||
"model": "openai/whisper-large-v3",
|
||||
}
|
||||
url = openai_api_base + "/audio/transcriptions"
|
||||
headers = {"Authorization": f"Bearer {openai_api_key}"}
|
||||
print("transcription result:", end=' ')
|
||||
async with httpx.AsyncClient() as client:
|
||||
with open(str(winning_call), "rb") as f:
|
||||
async with client.stream('POST', url, files={'file': f},
|
||||
data=data) as response:
|
||||
async with client.stream('POST',
|
||||
url,
|
||||
files={'file': f},
|
||||
data=data,
|
||||
headers=headers) as response:
|
||||
async for line in response.aiter_lines():
|
||||
# Each line is a JSON object prefixed with 'data: '
|
||||
if line:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user