File size: 516 Bytes
8031a8f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
import whisper
from .voice_confidence import calc_voice_confidence_score
def main(file_path: str, model_size: str = "base") -> dict:
try:
# Load the Whisper model
whisper_model = whisper.load_model(model_size)
# Calculate the voice confidence score
result = calc_voice_confidence_score(file_path, whisper_model)
# Return the result as a dictionary
return {"voice_confidence_score": round(result, 2)}
except Exception as e:
return {"error": str(e)}
|