-
Notifications
You must be signed in to change notification settings - Fork 463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix delta on combining memories #825
Conversation
WalkthroughThis update introduces a new attribute Changes
Uplevel your code reviews with Entelligence.AI ProEntelligence.AI ProIf you like this project, please support us by purchasing the Pro version. The Pro version has advanced context, superior noise reduction and several proprietary improvements compared to the open source version. Moreover, Entelligence.AI Pro is free for open source projects. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Files selected (2)
- backend/models/processing_memory.py (1)
- backend/routers/transcribe.py (5)
Review comments generated (4)
- Review: 3
- LGTM: 1
Tips
Chat with Entelligence.AI Bot (@Entelligence.AI
)
- Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
- Invite the bot into a review comment chain by tagging
@Entelligence.AI
in a reply.
Code suggestions
- The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
- You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.
Pausing incremental reviews
- Add
@Entelligence.AI: ignore
anywhere in the PR description to pause further reviews from the bot.
@@ -14,6 +14,7 @@ class ProcessingMemory(BaseModel): | |||
audio_url: Optional[str] = None | |||
created_at: datetime | |||
timer_start: float | |||
timer_starts: List[float] = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The addition of timer_starts
attribute seems fine. However, it's important to ensure that this list is managed properly throughout the codebase. If the list grows indefinitely, it could lead to memory issues. Consider implementing a mechanism to limit its size or clean up old entries if not needed.
- timer_starts: List[float] = []
+ timer_starts: List[float] = [] # Ensure proper management to avoid potential memory issues
if delta_seconds > 0: | ||
new_segment.start += delta_seconds | ||
new_segment.end += delta_seconds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code is modifying the start
and end
attributes of new_segment
directly. This could lead to unexpected behavior if these objects are used elsewhere in the code, as they are being mutated here. Consider creating a new object with the updated values instead of mutating the existing one.
- new_segment.start += delta_seconds
- new_segment.end += delta_seconds
+ adjusted_segment = Segment(start=new_segment.start + delta_seconds, end=new_segment.end + delta_seconds)
# Track timer start | ||
processing_memory.timer_starts.append(timer_start) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're appending timer_start
to processing_memory.timer_starts
, but there's no check to ensure that timer_start
is not already in the list. If it's possible for the same timer_start
value to be added multiple times, you should add a check to prevent duplicates.
- processing_memory.timer_starts.append(timer_start)
+ if timer_start not in processing_memory.timer_starts:
+ processing_memory.timer_starts.append(timer_start)
Summary by Entelligence.AI
timer_starts
attribute in theProcessingMemory
class to enhance transcription accuracy. This feature adjusts segment start and end times based on a delta value, improving the overall user experience with more precise transcriptions.