added a comment

This commit is contained in:
2025-08-16 23:00:51 +05:30
parent ed1b3cf99f
commit 8751487f22
+6 -2
View File
@@ -19,7 +19,11 @@ app.add_middleware(
UPLOAD_DIR = "uploads" UPLOAD_DIR = "uploads"
os.makedirs(UPLOAD_DIR, exist_ok=True) os.makedirs(UPLOAD_DIR, exist_ok=True)
'''
the Whisper model "small" is loaded by default.
Users can change it to other models based on their systems processing power.
namely "tiny", "base", "medium", "large".
'''
model = whisper.load_model("small") model = whisper.load_model("small")
def calculate_similarity(expected: str, actual: str) -> float: def calculate_similarity(expected: str, actual: str) -> float:
@@ -35,7 +39,7 @@ def text_to_phonemes(text: str) -> str:
if phones: if phones:
phoneme_list.append(phones[0]) phoneme_list.append(phones[0])
else: else:
phoneme_list.append("[UNK]") # mark as unknown pronunciation phoneme_list.append("[UNK]")
return " ".join(phoneme_list) return " ".join(phoneme_list)