henryu commited on
Commit
3c96115
·
1 Parent(s): aa187ba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -23,11 +23,10 @@ def transcribe(microphone, file_upload):
23
 
24
  openai.api_key = "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"
25
  device = 0 if torch.cuda.is_available() else "cpu"
26
-
27
  res_format = 'srt'
28
- pipe = openai.Audio.transcribe(model="whisper-1", file=file, response_format=res_format, prompt='请使用书面语')
29
 
30
- text = pipe["text"] # 获取转录文本结果
31
 
32
  return warn_output + text
33
 
 
23
 
24
  openai.api_key = "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"
25
  device = 0 if torch.cuda.is_available() else "cpu"
 
26
  res_format = 'srt'
27
+ transcript = openai.Audio.transcribe(model="whisper-1", file=file, response_format=res_format, prompt='请使用书面语')
28
 
29
+ text = transcript
30
 
31
  return warn_output + text
32