smease commited on
Commit
b6c4628
·
1 Parent(s): 862c0a8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -22,8 +22,8 @@ def autoplay_audio(exported_audio):
22
  unsafe_allow_html=True,
23
  )
24
 
25
- model = whisper.load_model("base")
26
-
27
  st.title("Whisper App")
28
  audio = audiorecorder("Click to record", "Click to stop recording")
29
 
@@ -33,6 +33,10 @@ if len(audio) > 0:
33
  exported_audio = audio.export()
34
  #st.audio(exported_audio.read())
35
  #autoplay_audio(exported_audio)
36
- result = model.transcribe(exported_audio.read())
37
- st.write(result["text"])
 
 
 
 
38
 
 
22
  unsafe_allow_html=True,
23
  )
24
 
25
+ #model = whisper.load_model("base")
26
+ client = OpenAI()
27
  st.title("Whisper App")
28
  audio = audiorecorder("Click to record", "Click to stop recording")
29
 
 
33
  exported_audio = audio.export()
34
  #st.audio(exported_audio.read())
35
  #autoplay_audio(exported_audio)
36
+ #result = model.transcribe(exported_audio.read())
37
+ transcript = client.audio.transcriptions.create(
38
+ model="whisper-1",
39
+ file=exported_audio.read()
40
+ )
41
+ st.write(transcript)
42