Skip to content

Commit

Permalink
refactor: Improve parameters for audio transcription.
Browse files Browse the repository at this point in the history
- Update parameters for creating audio transcriptions in `transcribe_chunk` function
- Refactor code for improved readability and maintainability
  • Loading branch information
johnnyhuy committed Apr 9, 2024
1 parent eec6cc9 commit 80977f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion transcribe_me/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def transcribe_chunk(file_path: str) -> str:
"""
with open(file_path, "rb") as audio_file:
try:
response = openai.audio.transcriptions.create(model="whisper-1", file=audio_file)
response = openai.audio.transcriptions.create(language="en", model="whisper-1", file=audio_file)
return response.text
except Exception as e:
print(f"{Fore.RED}An error occurred while transcribing {file_path}: {e}")
Expand Down

0 comments on commit 80977f9

Please sign in to comment.