Dominik Macháček
commited on
Commit
·
d65fd8a
1
Parent(s):
50f1b94
fixes
Browse files- whisper_online.py +3 -3
whisper_online.py
CHANGED
|
@@ -215,9 +215,9 @@ class OpenaiApiASR(ASRBase):
|
|
| 215 |
"temperature": self.temperature
|
| 216 |
}
|
| 217 |
if self.task != "translate" and self.language:
|
| 218 |
-
|
| 219 |
if prompt:
|
| 220 |
-
|
| 221 |
|
| 222 |
if self.task == "translate":
|
| 223 |
proc = self.client.audio.translations
|
|
@@ -227,7 +227,7 @@ class OpenaiApiASR(ASRBase):
|
|
| 227 |
# Process transcription/translation
|
| 228 |
|
| 229 |
transcript = proc.create(**params)
|
| 230 |
-
print(f"OpenAI API processed accumulated {self.transcribed_seconds} seconds
|
| 231 |
|
| 232 |
return transcript.segments
|
| 233 |
|
|
|
|
| 215 |
"temperature": self.temperature
|
| 216 |
}
|
| 217 |
if self.task != "translate" and self.language:
|
| 218 |
+
params["language"] = self.language
|
| 219 |
if prompt:
|
| 220 |
+
params["prompt"] = prompt
|
| 221 |
|
| 222 |
if self.task == "translate":
|
| 223 |
proc = self.client.audio.translations
|
|
|
|
| 227 |
# Process transcription/translation
|
| 228 |
|
| 229 |
transcript = proc.create(**params)
|
| 230 |
+
print(f"OpenAI API processed accumulated {self.transcribed_seconds} seconds",file=self.logfile)
|
| 231 |
|
| 232 |
return transcript.segments
|
| 233 |
|