mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-06 12:45:00 +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())
|
file.write(self.q.get())
|
||||||
|
|
||||||
with open(filename, "rb") as fh:
|
with open(filename, "rb") as fh:
|
||||||
transcript = litellm.transcription(
|
try:
|
||||||
model="whisper-1", file=fh, prompt=history, language=language
|
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
|
text = transcript.text
|
||||||
return text
|
return text
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue