Spaces:
Runtime error
Runtime error
sergiolucero
commited on
Commit
•
9bf3f26
1
Parent(s):
2b4c43b
Update ailib.py
Browse files
ailib.py
CHANGED
@@ -1,13 +1,15 @@
|
|
1 |
import openai
|
2 |
import time
|
3 |
|
|
|
|
|
4 |
def whisper_transcribe(fn, temperature=0):
|
5 |
t0 = time.time()
|
6 |
audio_file = open(fn,'rb') # redundant?
|
7 |
whisper = openai_client.audio.transcriptions.create
|
8 |
transcript = whisper(model=OPENAI_TRANSCRIPTION_MODEL,
|
9 |
file=audio_file, language='es',
|
10 |
-
temperature=
|
11 |
dt = round(time.time()-t0,2)
|
12 |
|
13 |
transcript = transcript.text
|
|
|
1 |
import openai
|
2 |
import time
|
3 |
|
4 |
+
OPENAI_TRANSCRIPTION_MODEL='whisper-v1'
|
5 |
+
|
6 |
def whisper_transcribe(fn, temperature=0):
|
7 |
t0 = time.time()
|
8 |
audio_file = open(fn,'rb') # redundant?
|
9 |
whisper = openai_client.audio.transcriptions.create
|
10 |
transcript = whisper(model=OPENAI_TRANSCRIPTION_MODEL,
|
11 |
file=audio_file, language='es',
|
12 |
+
temperature=0.0) # to do, explore temperature
|
13 |
dt = round(time.time()-t0,2)
|
14 |
|
15 |
transcript = transcript.text
|