Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -24,7 +24,7 @@ def transcribe(microphone, file_upload):
|
|
| 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=open(
|
| 28 |
|
| 29 |
text = transcript
|
| 30 |
|
|
|
|
| 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=open(file, 'rb'), response_format=res_format, prompt='请使用书面语')
|
| 28 |
|
| 29 |
text = transcript
|
| 30 |
|