mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-05 04:05:04 +00:00
feat: add error handling for transcription in Voice class
This commit is contained in:
parent
b3ce70234e
commit
aedba59c6e
1 changed files with 7 additions and 3 deletions
|
@ -104,9 +104,13 @@ class Voice:
|
|||
file.write(self.q.get())
|
||||
|
||||
with open(filename, "rb") as fh:
|
||||
transcript = litellm.transcription(
|
||||
model="whisper-1", file=fh, prompt=history, language=language
|
||||
)
|
||||
try:
|
||||
transcript = litellm.transcription(
|
||||
model="whisper-1", file=fh, prompt=history, language=language
|
||||
)
|
||||
except Exception as err:
|
||||
print(f"Unable to transcribe {filename}: {err}")
|
||||
return
|
||||
|
||||
text = transcript.text
|
||||
return text
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue