Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
| 29 |
|
| 30 |
-
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 |
|