Add directions to whisper

This commit is contained in:
root
2023-09-03 23:03:08 +00:00
parent 07e2bf9854
commit 84514ef955
2 changed files with 3 additions and 1 deletions

View File

@@ -341,7 +341,8 @@ class OpenAIHelper:
"""
try:
with open(filename, "rb") as audio:
result = await openai.Audio.atranscribe("whisper-1", audio)
prompt_text = os.environ.get('WHISPER_PROMPT', '')
result = await openai.Audio.atranscribe("whisper-1", audio, prompt=prompt_text)
return result.text
except Exception as e:
logging.exception(e)