Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
khanh nguyen
Openai Service
Commits
e18aa9a8
Commit
e18aa9a8
authored
Oct 01, 2025
by
server1
Browse files
KHANHNQ: init service openai
parents
Pipeline
#452
failed with stages
in 0 seconds
Changes
41
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
test_mic.py
0 → 100644
View file @
e18aa9a8
import
librosa
import
numpy
as
np
from
openai
import
OpenAI
client
=
OpenAI
()
with
open
(
"test_mic.mp3"
,
"rb"
)
as
audio_file
:
transcript
=
client
.
audio
.
transcriptions
.
create
(
model
=
"whisper-1"
,
file
=
audio_file
,
prompt
=
"Trả về nội dung file. Không được đoán bừa nội dung file. Nếu file không có gì hoặc im lặng hãy trả về là không có tiếng"
)
print
(
transcript
.
text
)
Prev
1
2
3
Next
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