Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
d586ddc6
Unverified
Commit
d586ddc6
authored
May 01, 2025
by
zh Wang
Committed by
GitHub
Apr 30, 2025
Browse files
[BugFix] Fix authorization of openai_transcription_client.py (#17321)
Signed-off-by:
zh Wang
<
rekind133@outlook.com
>
parent
0b7e701d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
examples/online_serving/openai_transcription_client.py
examples/online_serving/openai_transcription_client.py
+6
-2
No files found.
examples/online_serving/openai_transcription_client.py
View file @
d586ddc6
...
...
@@ -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
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment