Skip to content

Speakr is a personal, self-hosted web application designed for transcribing audio recordings

Python

Fix clear-voice-embeddings: null the real average_embedding column, not a phantom attribute

Murtaza Nasir10b12beeff51
diff --git a/src/api/speakers.py b/src/api/speakers.py
index 2151edf6..4224b069 100644
--- a/src/api/speakers.py
+++ b/src/api/speakers.py
@@ -388,8 +388,14 @@ def clear_speaker_embeddings(speaker_id):
if not speaker:
return jsonify({'error': 'Speaker not found'}), 404
- # Clear all embeddings
- speaker.voice_embeddings = None
+ # Clear all embeddings. NOTE: the matchable vector lives in the
+ # `average_embedding` column (and the history in `embeddings_history`)
+ # — there is NO `voice_embeddings` column. The previous code set a
+ # phantom `voice_embeddings` attribute that never persisted, so the
+ # real average_embedding survived and voice matching kept working
+ # after a "clear". Null out the actual columns.
+ speaker.average_embedding = None
+ speaker.embeddings_history = None
speaker.embedding_count = 0
speaker.confidence_score = None