mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-13 19:34:59 +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",
|
"model": "openai/whisper-large-v3",
|
||||||
}
|
}
|
||||||
url = openai_api_base + "/audio/transcriptions"
|
url = openai_api_base + "/audio/transcriptions"
|
||||||
|
headers = {"Authorization": f"Bearer {openai_api_key}"}
|
||||||
print("transcription result:", end=' ')
|
print("transcription result:", end=' ')
|
||||||
async with httpx.AsyncClient() as client:
|
async with httpx.AsyncClient() as client:
|
||||||
with open(str(winning_call), "rb") as f:
|
with open(str(winning_call), "rb") as f:
|
||||||
async with client.stream('POST', url, files={'file': f},
|
async with client.stream('POST',
|
||||||
data=data) as response:
|
url,
|
||||||
|
files={'file': f},
|
||||||
|
data=data,
|
||||||
|
headers=headers) as response:
|
||||||
async for line in response.aiter_lines():
|
async for line in response.aiter_lines():
|
||||||
# Each line is a JSON object prefixed with 'data: '
|
# Each line is a JSON object prefixed with 'data: '
|
||||||
if line:
|
if line:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user