Commit e18aa9a8 authored by server1's avatar server1
Browse files

KHANHNQ: init service openai

parents
Pipeline #452 failed with stages
in 0 seconds
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)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment