Skip to content

Commit

Permalink
Use timmer start to validate create new memory
Browse files Browse the repository at this point in the history
  • Loading branch information
beastoin committed Sep 22, 2024
1 parent 8465de6 commit 60b33c4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions backend/routers/transcribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,9 +586,8 @@ async def _try_flush_new_memory(time_validate: bool = True):
# Longer 120s
now = time.time()
should_create_memory_time = True
timer_segment_start = timer_start + segment_start
if time_validate:
should_create_memory_time = timer_segment_start + segment_end + min_seconds_limit < now
should_create_memory_time = timer_start + segment_end + min_seconds_limit < now

# 1 words at least
should_create_memory_time_words = min_words_limit == 0
Expand All @@ -602,7 +601,7 @@ async def _try_flush_new_memory(time_validate: bool = True):

should_create_memory = should_create_memory_time and should_create_memory_time_words
print(
f"Should create memory {should_create_memory} - {timer_segment_start} {segment_end} {min_seconds_limit} {now} - {time_validate}, session {session_id}")
f"Should create memory {should_create_memory} - {timer_start} {segment_end} {min_seconds_limit} {now} - {time_validate}, session {session_id}")
if should_create_memory:
memory = await _create_memory()
if not memory:
Expand Down

0 comments on commit 60b33c4

Please sign in to comment.