Fix all commands and cleanup

This commit is contained in:
BillSchumacher
2023-04-19 18:17:04 -05:00
parent 23c650ca10
commit d7679d755f
16 changed files with 63 additions and 83 deletions

View File

@@ -13,11 +13,11 @@ CFG = Config()
@command(
"read_audio_from_file",
"Convert Audio to text",
'"file": "<file>"',
'"filename": "<filename>"',
CFG.huggingface_audio_to_text_model,
"Configure huggingface_audio_to_text_model.",
)
def read_audio_from_file(audio_path: str) -> str:
def read_audio_from_file(filename: str) -> str:
"""
Convert audio to text.
@@ -27,7 +27,7 @@ def read_audio_from_file(audio_path: str) -> str:
Returns:
str: The text from the audio
"""
audio_path = path_in_workspace(audio_path)
audio_path = path_in_workspace(filename)
with open(audio_path, "rb") as audio_file:
audio = audio_file.read()
return read_audio(audio)