Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -839,11 +839,12 @@ def format_output_word(word_text: str, similarity_score: float, detected_phoneme
|
|
839 |
return output_text, colored_text
|
840 |
|
841 |
@app.post("/api/transcribe")
|
842 |
-
async def transcribe(audio: UploadFile = File(...)):
|
843 |
log("=== STARTING WHISPERX ENGLISH-ONLY PHONEME ANALYSIS ===")
|
844 |
|
845 |
-
#
|
846 |
-
similarity = 0.
|
|
|
847 |
|
848 |
try:
|
849 |
# Load WhisperX models if needed
|
|
|
839 |
return output_text, colored_text
|
840 |
|
841 |
@app.post("/api/transcribe")
|
842 |
+
async def transcribe(audio: UploadFile = File(...), similarity_threshold: float = Form(0.4)):
|
843 |
log("=== STARTING WHISPERX ENGLISH-ONLY PHONEME ANALYSIS ===")
|
844 |
|
845 |
+
# Use similarity threshold from frontend (default 0.4)
|
846 |
+
similarity = max(0.0, min(1.0, similarity_threshold)) # Clamp between 0 and 1
|
847 |
+
log(f"Using similarity threshold: {similarity:.2f}")
|
848 |
|
849 |
try:
|
850 |
# Load WhisperX models if needed
|