mirror of
https://github.com/Manoj-HV30/PhonoCoach.git
synced 2026-05-16 19:35:26 +00:00
added a comment
This commit is contained in:
+6
-2
@@ -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 system’s 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)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user