From 44982fd43960731d75398d1097a6b93d05762550 Mon Sep 17 00:00:00 2001 From: Bradley Bickford Date: Sat, 6 Jan 2024 15:35:12 -0500 Subject: [PATCH] Pushing up an attempted fix for breadmixer not being able to submit transcriptions to the database --- bin/breadmixer.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/breadmixer.py b/bin/breadmixer.py index 925ddc1..44bc874 100644 --- a/bin/breadmixer.py +++ b/bin/breadmixer.py @@ -62,6 +62,8 @@ cursor.execute("SELECT call_start_time FROM call_states WHERE call_id = %s", [ar call_start_time = cursor.fetchall() +cursor.close() + if len(call_start_time) == 0: print('{call_id} does not exist in the database'.format(call_id=args.callid)) @@ -188,9 +190,11 @@ transcribe = Transcription("openai/whisper-base") for (k, v) in file_dict.items(): text = transcribe(k) + cursor = mydb.cursor() cursor.execute("INSERT INTO call_transcriptions (call_id, user_snowflake, speaking_start_time, text) VALUES (%s, %s, %s, %s)", [ args.callid, v["user"], v["real_date"], text ]) + cursor.close()