Coco-18 commited on
Commit
c0e9084
Β·
verified Β·
1 Parent(s): 2f7060f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -704,6 +704,12 @@ def evaluate_pronunciation():
704
  best_reference = os.path.basename(ref_file)
705
  best_transcription = ref_transcription
706
  logger.info(f"πŸ“Š New best match: {best_reference} with score {best_score:.2f}%")
 
 
 
 
 
 
707
  except Exception as e:
708
  logger.error(f"❌ Error processing reference audio {ref_file}: {str(e)}")
709
  logger.debug(f"Stack trace: {traceback.format_exc()}")
 
704
  best_reference = os.path.basename(ref_file)
705
  best_transcription = ref_transcription
706
  logger.info(f"πŸ“Š New best match: {best_reference} with score {best_score:.2f}%")
707
+
708
+ # Add this early exit condition here
709
+ if similarity > 80.0: # If we find a really good match
710
+ logger.info(f"🏁 Found excellent match (>80%). Stopping evaluation early.")
711
+ break # Exit the loop early
712
+
713
  except Exception as e:
714
  logger.error(f"❌ Error processing reference audio {ref_file}: {str(e)}")
715
  logger.debug(f"Stack trace: {traceback.format_exc()}")